b_sms.js
1.44 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
72
73
74
75
76
77
78
// pages/book/b_sms.js
var util = require('../../../utils/util.js')
import App from '../../../utils/api';
Page({
/**
* 页面的初始数据
*/
tplsIndex: 'SMS_163050401',
data: {
bookInfo: {},
tplMsg: ''
},
sc:{},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.options=options;
this.enter_params=util.cache('enter_params');
this.getDetail();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
bookInfo: null,
async getDetail(){
let msg=await App.SendSMS.GetSmsContent({rid: this.options.id});
console.log('tplMsg',msg.data.content)
this.setData({
tplMsg: msg.data.content
})
},
sendsms(){
App.SendSMS.NewMessage({
rid: this.options.id,
sid:this.enter_params.seller_id,
}).then(res=>{
if (res.ret != 200) {
return util.toast(res.msg, 'none');
}
util.toast('短信已发送');
this.setData({
hideSendsms: true,
})
App.Reserve.SmsInfo({seller_id: this.enter_params.seller_id}, 'clear')
})
},
copysms(){
wx.setClipboardData({
data: this.data.tplMsg
})
},
})