活动营销

This commit is contained in:
Vinjor 2024-09-27 20:37:19 +08:00
parent 3e1542cc93
commit 4e85a2906a

View File

@ -7,24 +7,28 @@
<text class="uni-body">{{ item.remark }}</text>
<view slot="actions" class="card-actions">
<picker v-if="item.type=='kkyl'" @change="bindPickerChange" :value="index" :range="array">
<button @click="joinAct(item)" type="primary">参加</button>
<button type="primary">参加</button>
</picker>
<view v-if="item.type!='kkyl'">
<view v-if="item.type=='zcyl'">
<button @click="joinAct(item)" v-if="item.isJoin!='1'" type="primary">参加</button>
<button @click="joinAct(item)" v-if="item.isJoin=='1'" disabled type="primary">参加</button>
</view>
<view v-if="item.type=='czyl'">
<button @click="joinCzylActPrex(item)" type="primary">参加</button>
</view>
</view>
</uni-card>
<uni-section title="输入框示例" type="line" padding>
<view class="dialog-box">
<text class="dialog-text">输入内容{{ value }}</text>
</view>
<button class="button" type="primary" @click="inputDialogToggle"><text
class="button-text">输入对话框</text></button>
</uni-section>
</view>
<view>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="充值" value=""
placeholder="请输入充值金额" @confirm="dialogInputConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</view>
</template>
<script>
@ -47,6 +51,10 @@ export default {
activeList: [],
//id
kkylActId:"",
//id
czylActId:"",
//
topUpAmount:0.0,
tabList: [{
value: 0,
title: '礼包券'
@ -73,8 +81,23 @@ export default {
this.getActive()
},
methods: {
inputDialogToggle(){
isNumber(value) {
return /^\d+(\.\d+)?$/.test(value);
},
dialogInputConfirm(val) {
if(this.isNumber(val)){
console.log(val)
this.topUpAmount = val
//
this.joinCzylAct()
//
this.$refs.inputDialog.close()
}else{
uni.showToast({
title: '请输入数字!',
icon: 'none'
})
}
},
bindPickerChange(e){
this.index = e.detail.value
@ -121,7 +144,7 @@ export default {
},
/**
* 参加活动
* 参加注册活动
* @param item
* @returns {Promise<void>}
*/
@ -129,8 +152,6 @@ export default {
let dataObj = {}
let url = ""
let method = "POST"
if(item.type == 'zcyl'){
//
dataObj.cusId = this.customInfo.id
dataObj.activeId = item.id
url = "/userClient/customer/attendActive"
@ -140,13 +161,7 @@ export default {
data: dataObj
}).then((res) => {
console.log(res);
this.orderInfo = res.data
})
}else if(item.type == 'kkyl'){
//
}
},
/**
* 参加开卡有礼活动
@ -164,11 +179,38 @@ export default {
data:dataObj
}).then((res) => {
console.log(res);
// TODO
this.orderInfo = res.data
})
},
/**
* 充值有礼前置方法
* @returns {Promise<void>}
*/
async joinCzylActPrex(item){
this.$refs.inputDialog.open()
this.czylActId = item.id
},
/**
* 充值有礼
* @returns {Promise<void>}
*/
async joinCzylAct(){
let dataObj = {}
dataObj.cusId = this.customInfo.id
dataObj.activeId = this.czylActId
dataObj.accountType='01'
dataObj.topUpAmount=this.topUpAmount
await request({
url: "/userClient/customer/attendActive",
method: "POST",
data:dataObj
}).then((res) => {
console.log(res);
// TODO
this.orderInfo = res.data
})
}
}
}
</script>