Commit 4922c052 by chenwq

按钮重复点击;详情页loading加到800ms

1 parent 33f943dd
...@@ -64,7 +64,7 @@ Component({ ...@@ -64,7 +64,7 @@ Component({
setTimeout(() => { setTimeout(() => {
wx.hideLoading() wx.hideLoading()
this.getImgHeight() this.getImgHeight()
}, 400) }, 800)
}, },
}, },
......
...@@ -118,9 +118,11 @@ page { ...@@ -118,9 +118,11 @@ page {
.crowd-video { .crowd-video {
width: calc(100% - 64rpx); width: calc(100% - 64rpx);
height: 386rpx;
position: absolute; position: absolute;
top: 264rpx; top: 264rpx;
margin: 0 32rpx; margin: 0 32rpx;
border-radius: 16rpx;
} }
.more-btn { .more-btn {
......
...@@ -24,7 +24,8 @@ Page({ ...@@ -24,7 +24,8 @@ Page({
}, { }, {
title: '申请产品', title: '申请产品',
name: 2 name: 2
}] }],
isLoading: false
}, },
// computed: { // computed: {
// hasProdAct(data) { // hasProdAct(data) {
...@@ -47,6 +48,9 @@ Page({ ...@@ -47,6 +48,9 @@ Page({
}, },
// 申请业务 // 申请业务
applyBusiness() { applyBusiness() {
if (this.data.isLoading) {
return
}
const subCompData = this.selectComponent('#apply-business').data const subCompData = this.selectComponent('#apply-business').data
let { name } = subCompData.carObj let { name } = subCompData.carObj
// console.log('name: ', name) // console.log('name: ', name)
...@@ -63,7 +67,7 @@ Page({ ...@@ -63,7 +67,7 @@ Page({
let { carObj, selectProdArr } = subCompData let { carObj, selectProdArr } = subCompData
let { clueId } = this.data let { clueId } = this.data
let selectProdArrStr = '' let selectProdArrStr = ''
selectProdArr.forEach((item,index)=>{selectProdArrStr+=`${item.productName}${selectProdArr.length-1 == index?'':';'}`}) selectProdArr.forEach((item, index) => { selectProdArrStr += `${item.productName}${selectProdArr.length - 1 == index ? '' : ';'}` })
let { userInfo } = wx.$storage.get() let { userInfo } = wx.$storage.get()
let MerchantInfo = userInfo.subLoginUser let MerchantInfo = userInfo.subLoginUser
...@@ -77,9 +81,11 @@ Page({ ...@@ -77,9 +81,11 @@ Page({
carType: carObj.model, carType: carObj.model,
baseCustomer: carObj.selNum, baseCustomer: carObj.selNum,
clueId, clueId,
intentProducts:selectProdArrStr intentProducts: selectProdArrStr
} }
this.setData({
isLoading: true
})
// return wx.$api.showToast('申请成功') // return wx.$api.showToast('申请成功')
applyApi applyApi
.merchantApply(params) .merchantApply(params)
...@@ -94,10 +100,17 @@ Page({ ...@@ -94,10 +100,17 @@ Page({
}, 1000) }, 1000)
} }
}) })
.catch(err => {}) .catch(err => {
this.setData({
isLoading: false
})
})
}, },
// 申请产品 // 申请产品
applyProduct() { applyProduct() {
if (this.data.isLoading) {
return
}
const subCompData = this.selectComponent('#apply-product').data const subCompData = this.selectComponent('#apply-product').data
let { prodName, selectStoreItem } = subCompData let { prodName, selectStoreItem } = subCompData
if (!prodName) { if (!prodName) {
...@@ -107,7 +120,7 @@ Page({ ...@@ -107,7 +120,7 @@ Page({
}) })
return return
} }
if(utils.isEmptyObj(selectStoreItem)){ if (utils.isEmptyObj(selectStoreItem)) {
wx.pro.showToast({ wx.pro.showToast({
title: '请选择合作门店', title: '请选择合作门店',
icon: 'error' icon: 'error'
...@@ -118,27 +131,34 @@ Page({ ...@@ -118,27 +131,34 @@ Page({
this.submitProductForm(subCompData) this.submitProductForm(subCompData)
}, },
async submitProductForm(subCompData) { async submitProductForm(subCompData) {
let {prodName,selectStoreItem} = subCompData let { prodName, selectStoreItem } = subCompData
let userInfo = wx.$storage.get('userInfo') let userInfo = wx.$storage.get('userInfo')
let params = { let params = {
...selectStoreItem, ...selectStoreItem,
serviceMerchantId:userInfo.merchantId, serviceMerchantId: userInfo.merchantId,
serviceMerchantName:userInfo.merchantName, serviceMerchantName: userInfo.merchantName,
coProduct:prodName coProduct: prodName
} }
let {code} = await addCoProductApi(params) this.setData({
if(code == 0){ isLoading: true
})
let { code } = await addCoProductApi(params)
if (code == 0) {
wx.$api.showToast('申请成功') wx.$api.showToast('申请成功')
setTimeout(() => { setTimeout(() => {
wx.$router.back() wx.$router.back()
}, 1000) }, 1000)
} else {
this.setData({
isLoading: false
})
} }
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) {}, onLoad(options) { },
onRoute(params) { onRoute(params) {
// 线索id // 线索id
this.setData({ this.setData({
...@@ -150,35 +170,35 @@ Page({ ...@@ -150,35 +170,35 @@ Page({
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() {}, onReady() { },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() { },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() {}, onHide() { },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() {}, onUnload() { },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() {}, onPullDownRefresh() { },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() {}, onReachBottom() { },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {} onShareAppMessage() { }
}) })
...@@ -27,6 +27,7 @@ Page({ ...@@ -27,6 +27,7 @@ Page({
}, },
sceneActive: 1, sceneActive: 1,
sceneCodeActive: 'SC001', sceneCodeActive: 'SC001',
isLoading: false,
// 活动内容 // 活动内容
activityList: [], activityList: [],
sceneActivityObj: { sceneActivityObj: {
...@@ -103,6 +104,9 @@ Page({ ...@@ -103,6 +104,9 @@ Page({
}, },
handleConfirm() { handleConfirm() {
if(this.data.isLoading) {
return
}
var params = { var params = {
serviceMerchantId: this.data.merchantInfo.pMerchantId, serviceMerchantId: this.data.merchantInfo.pMerchantId,
serviceMerchantName: this.data.merchantInfo.pMerchantName, serviceMerchantName: this.data.merchantInfo.pMerchantName,
...@@ -116,6 +120,9 @@ Page({ ...@@ -116,6 +120,9 @@ Page({
wx.$api.showToast('请选产品/活动') wx.$api.showToast('请选产品/活动')
return true return true
} }
this.setData({
isLoading: true
})
outputApi.applyActivity(params).then(res => { outputApi.applyActivity(params).then(res => {
wx.showToast({ wx.showToast({
title: '提交成功', title: '提交成功',
...@@ -126,6 +133,10 @@ Page({ ...@@ -126,6 +133,10 @@ Page({
this.handleJump() this.handleJump()
} }
}) })
}).catch(() => {
this.setData({
isLoading: false
})
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!