123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- showUploadTip: false,
- haveGetRecord: false,
- envId: '',
- record: ''
- },
- onLoad(options) {
- this.setData({
- envId: options.envId
- });
- wx.showLoading({
- title: '',
- });
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'selectRecord'
- }
- }).then((resp) => {
- this.setData({
- record: resp.result.data
- });
- wx.hideLoading();
- }).catch((e) => {
- console.log(e);
- this.setData({
- showUploadTip: true
- });
- wx.hideLoading();
- });
- },
- updateRecord() {
- wx.showLoading({
- title: '',
- });
- wx.cloud.callFunction({
- name: 'quickstartFunctions',
- data: {
- type: 'updateRecord',
- data: this.data.record
- }
- }).then((resp) => {
- wx.navigateTo({
- url: `/pages/updateRecordSuccess/index`,
- });
- wx.hideLoading();
- }).catch((e) => {
- console.log(e);
- this.setData({
- showUploadTip: true
- });
- wx.hideLoading();
- });
- },
- bindInput (e) {
- const index = e.currentTarget.dataset.index;
- const record = this.data.record;
- record[index].sales = Number(e.detail.value);
- this.setData({
- record
- });
- },
- });
|