123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- const app = getApp()
- import {
- exchangemobile,
- } from '~/api/user'
- import {
- registerSale
- } from '~/api/sale'
- Page({
- data: {
- menuTop: app.globalData.menuTop,
- username: '',
- mobile: '',
- isSubmit: false
- },
- bindblur(e) {
- this.setData({
- username: e.detail.value.trim()
- })
- },
- async getmobileNumber({
- detail
- }) {
- let mobile = await exchangemobile({
- code: detail.code
- })
- this.setData({
- mobile
- })
- },
- black() {
- wx.navigateBack()
- },
- async submit() {
- let {
- mobile,
- username
- } = this.data
- this.setData({
- isSubmit: true
- })
- if (mobile && username) {
- let res = await registerSale({
- mobile,
- name: username
- })
- wx.redirectTo({
- url: '/salesperson/pages/saleOffice/index',
- })
- }
- }
- })
|