| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- var _request = require('../../../../utils/request.js')
- var util = require('../../../../utils/util.js')
- Page({
- data: {
- page: 1,
- per_page: 20,
- list: [],
- more: true,
- balance: 0,
- userinfo:{},
- applylist:'',
- tel: '',
- uid:0
- },
- onLoad: function (options) {
- var uid = options.uid;
- this.getUserOrderInfo(uid);
- this.getApplyList(uid);
- this.setData({
- uid: uid
- })
- },
- onShow () {
- },
- onReachBottom: function () {
- if (this.data.more) {
- var page = this.data.page + 1
- this.setData({
- page: page
- })
- this.getBalanceList()
- }
- },
- getUserOrderInfo(uid) {
- var that = this
- var url = 'v1/user/others_info/'+ uid
- var params = {
- }
- var success = function (res) {
- var result = res.data.wx_user
- that.setData({
- userinfo: result
- })
- }
- _request.$get(url, params, success)
- },
- getApplyList(uid) {
- var that = this
- var url = 'v1/user/history_apply/'+ uid
- var params = {
- }
- var success = function (res) {
- var result = res.data
- that.setData({
- applylist: result
- })
- }
- _request.$get(url, params, success)
- },
- applySubmit(){
- var that = this
- var url = 'v1/user/agent_apply';
- var tel = that.data.tel;
- var uid = that.data.uid;
- var params = {
- mobile:tel,
- wx_uid:uid
- }
- var success = function (res) {
- var result = res.data.result
- // that.setData({
- // applylist: result
- // })
- console.log('submitres',result)
- if(result){
- wx.showToast({
- title: '申请成功,请耐心等待审核!',
- icon: 'none',
- duration: 2000
- })
-
- that.getApplyList(uid);
-
- }
- }
- _request.$post(url, params, success)
- },
- getDetail (val) {
- var id = val.currentTarget.dataset.val
- wx.navigateTo({
- url: '/packageUser/pages/user/radishDetail/radishDetail?id=' + id
- })
- },
- bindPhone (e) {
- this.setData({
- tel: e.detail.value
- })
- },
- onShareAppMessage: function (val) {
- return _request.share({
- sc: 'xcx_user_radish'
- })
- }
- })
|