user_spsy.js
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// pages/user/usersy/usersy.js
var e = getApp(),os = e.globalData.setting;
var utils = require('../../../utils/util.js');
var regeneratorRuntime = require('../../../utils/runtime.js');
Page({
/**
* 页面的初始数据
*/
data: {
qr_code_object:{val:"12121",content:"请将二维码展示给核销员,取货更快捷!"},
xp_list:null,
iurl:os.imghost,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) { },
/**
* 生命周期函数--监听页面显示
*/
onShow:async function () {
var th = this;
var xp_list=null;
//--获取列表--
await getApp().request.promiseGet("http://172.20.3.102:8080/api/user_qy/xp_list", {
1: 1
}).then(res => {
xp_list = res.data;
})
th.setData({xp_list:xp_list});
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/*-- 打开服务项目 --*/
open_xp:function (e) {
var th=this;
var qc_com = this.selectComponent("#qc_com"); //组件的id
qc_com.open(th.data.qr_code_object)
},
//--领取商品--
get_xp:function (e) {
var th=this,index=e.currentTarget.dataset.ind;
getApp().request.post("http://172.20.3.102:8080/api/user_qy/get_gd",{
data:{},
success:function (e) {
if(e.data.code==0){
var txt="xp_list["+index+"].is_get"
var obj={};obj[txt]=1;
th.setData(obj);
}
}
})
}
})