zx 3 years ago
parent f5afa8843e
commit ce0af4005f

@ -73,7 +73,7 @@ App({
menuRight: 0, //胶囊按钮 距离屏幕右边的距离
request: function (prarms, callback) {
let obj = {
version: "1.1.2",
version: "1.1.3",
...prarms
}
return new Promise((resolve, reject) => {

@ -1,7 +1,6 @@
// pages/mine/pages/register/register.js
const app = getApp()
import timer from '../../../../utils/timer'
import Dialog from '../../../../miniprogram_npm/@vant/weapp/dialog/dialog';
Page({
/**
@ -95,15 +94,13 @@ Page({
return new Promise((resolve, reject) => {
app.globalData.request(obj, (res) => {
if (res.Code == 1) {
Dialog.alert({
wx.showModal({
title: '提示',
message: res.Msg,
selector:'#myDialog',
}).then(() => {
this.setData({status: 0, sVerifycode: ''});
this.getdata();
wx.navigateBack({delta: 1});
});
content: res.Msg,
})
this.setData({status: 0, sVerifycode: ''});
this.getdata();
wx.navigateBack({delta: 1});
}
resolve(true)
}).catch(err => {

@ -30,16 +30,4 @@
</view>
<button wx:if="{{status == 0}}" class="bts" bindtap="toEdit">编辑</button>
<button wx:else class="bts" bindtap="Submit">完成</button>
</view>
<van-dialog id="myDialog"></van-dialog>
<!-- <van-popup show="{{ show }}" custom-style="height: 80%;width: 100%;padding-bottom: 80rpx" position="bottom" bind:close="onClose">
<van-index-bar sticky="{{false}}" index-list="{{ [] }}">
<view wx:for="{{mockData}}" wx:key="idx">
<van-index-anchor index="{{item.name}}" />
<view class="my_cell" wx:for="{{item.data}}" data-brand="{{item2.brandname}}" wx:key="idx" wx:for-item="item2" bindtap="Brands">
<image slot="icon" class="bs-item-image" src="{{item2.img}}" lazy-load="{{true}}"></image>
<text>{{item2.brandname}}</text>
</view>
</view>
</van-index-bar>
</van-popup> -->
</view>

@ -37,7 +37,6 @@ Component({
}
wx.setStorageSync('brandData', this.data.boxArr)
wx.navigateTo({
// url: `/pages/varComm/pages/brandRatio/index`,
url: `/contrastPackages/brandRatio/index`,
})
},
@ -77,51 +76,55 @@ Component({
boxArr: result
})
},
getData() {
wx.showLoading({
title: '数据载入中....',
})
app.globalData.request({
action: 'getUserBrand',
token: wx.getStorageSync('token'),
}).then(res => {
let arr = []
for (let i = 65; i <= 90; i++) {
arr.push({
name: String.fromCharCode(i),
data: []
});
}
for (let i of res) {
for (let j of arr) {
if (i.firstword == j.name) {
j.data.push(i)
}
}
}
this.setData({
mockData: arr
});
})
if (wx.getStorageSync('brandData')) {
let boxArr = []
let result = []
for (let i of wx.getStorageSync('brandData')) {
i ? boxArr.push(i) : boxArr.push(null)
i ? result.push(JSON.stringify(i)) : ""
}
this.setData({
boxArr,
result
})
};
wx.hideLoading();
}
},
lifetimes: {
attached() {
this.getData();
},
},
pageLifetimes: {
show() {
//页面数据
wx.showLoading({
title: '数据载入中....',
})
app.globalData.request({
action: 'getUserBrand',
token: wx.getStorageSync('token'),
}).then(res => {
let arr = []
for (let i = 65; i <= 90; i++) {
arr.push({
name: String.fromCharCode(i),
data: []
});
}
for (let i of res) {
for (let j of arr) {
if (i.firstword == j.name) {
j.data.push(i)
}
}
}
this.setData({
mockData: arr
})
setTimeout(() => {
wx.hideLoading();
}, 1000)
})
if (wx.getStorageSync('brandData')) {
let boxArr = []
let result = []
for (let i of wx.getStorageSync('brandData')) {
i ? boxArr.push(i) : boxArr.push(null)
i ? result.push(JSON.stringify(i)) : ""
}
this.setData({
boxArr,
result
})
}
this.getData();
},
},
})
Loading…
Cancel
Save