You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.4 KiB
69 lines
1.4 KiB
import { urlPrefix, ossAK, ossHost } from '../../config/index';
|
|
import Toast, { hideToast } from 'tdesign-miniprogram/toast/index';
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
res_value: ''
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
this.setData({ res_value: wx.getStorageSync('txt_message') });
|
|
wx.removeStorageSync('txt_message');
|
|
},
|
|
onShow() {
|
|
|
|
},
|
|
|
|
regenerateHandle(e) {
|
|
let that = this;
|
|
Toast({
|
|
context: this,
|
|
selector: '#t-toast',
|
|
message: '生成中...',
|
|
theme: 'loading',
|
|
direction: 'column',
|
|
duration: -1
|
|
});
|
|
wx.request({
|
|
url: urlPrefix + '/QingLong/HuiYa/wxWenToWen',
|
|
method: "POST",
|
|
header: {
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
},
|
|
data: {
|
|
token: wx.getStorageSync('token'),
|
|
prompt: wx.getStorageSync('txt_prompt'),
|
|
limit: wx.getStorageSync('txt_word_count'),
|
|
platform_id: wx.getStorageSync('txt_type_id'),
|
|
},
|
|
success(res) {
|
|
that.setData({ res_value: res.data.message });
|
|
hideToast({
|
|
context: that,
|
|
selector: '#t-toast',
|
|
});
|
|
}
|
|
});
|
|
},
|
|
|
|
copyHandle(e) {
|
|
wx.setClipboardData({
|
|
data: this.data.res_value,
|
|
success(res) {
|
|
wx.getClipboardData();
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
})
|