Compare commits
No commits in common. "85121466ee50548915bab72f6d9b5818b015fbe4" and "aea2cf1ccb810d5a8c75b68f5292a8bc6ac2286a" have entirely different histories.
85121466ee
...
aea2cf1ccb
@ -7,28 +7,24 @@
|
|||||||
<text class="uni-body">{{ item.remark }}</text>
|
<text class="uni-body">{{ item.remark }}</text>
|
||||||
<view slot="actions" class="card-actions">
|
<view slot="actions" class="card-actions">
|
||||||
<picker v-if="item.type=='kkyl'" @change="bindPickerChange" :value="index" :range="array">
|
<picker v-if="item.type=='kkyl'" @change="bindPickerChange" :value="index" :range="array">
|
||||||
<button type="primary">参加</button>
|
<button @click="joinAct(item)" type="primary">参加</button>
|
||||||
</picker>
|
</picker>
|
||||||
<view v-if="item.type=='zcyl'">
|
<view v-if="item.type!='kkyl'">
|
||||||
<button @click="joinAct(item)" v-if="item.isJoin!='1'" type="primary">参加</button>
|
<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>
|
<button @click="joinAct(item)" v-if="item.isJoin=='1'" disabled type="primary">参加</button>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.type=='czyl'">
|
|
||||||
<button @click="joinCzylActPrex(item)" type="primary">参加</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</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>
|
||||||
|
|
||||||
</view>
|
</uni-section>
|
||||||
<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>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -51,10 +47,6 @@ export default {
|
|||||||
activeList: [],
|
activeList: [],
|
||||||
//开卡有礼活动id
|
//开卡有礼活动id
|
||||||
kkylActId:"",
|
kkylActId:"",
|
||||||
//充值有礼活动id
|
|
||||||
czylActId:"",
|
|
||||||
//充值金额
|
|
||||||
topUpAmount:0.0,
|
|
||||||
tabList: [{
|
tabList: [{
|
||||||
value: 0,
|
value: 0,
|
||||||
title: '礼包券'
|
title: '礼包券'
|
||||||
@ -81,23 +73,8 @@ export default {
|
|||||||
this.getActive()
|
this.getActive()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isNumber(value) {
|
inputDialogToggle(){
|
||||||
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){
|
bindPickerChange(e){
|
||||||
this.index = e.detail.value
|
this.index = e.detail.value
|
||||||
@ -144,24 +121,32 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 参加注册活动
|
* 参加活动
|
||||||
* @param item
|
* @param item
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async joinAct(item) {
|
async joinAct(item){
|
||||||
let dataObj = {}
|
let dataObj = {}
|
||||||
let url = ""
|
let url = ""
|
||||||
let method = "POST"
|
let method = "POST"
|
||||||
dataObj.cusId = this.customInfo.id
|
if(item.type == 'zcyl'){
|
||||||
dataObj.activeId = item.id
|
//注册有礼
|
||||||
url = "/userClient/customer/attendActive"
|
dataObj.cusId = this.customInfo.id
|
||||||
await request({
|
dataObj.activeId = item.id
|
||||||
url: url,
|
url = "/userClient/customer/attendActive"
|
||||||
method: method,
|
await request({
|
||||||
data: dataObj
|
url: url,
|
||||||
}).then((res) => {
|
method: method,
|
||||||
console.log(res);
|
data:dataObj
|
||||||
})
|
}).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.orderInfo = res.data
|
||||||
|
})
|
||||||
|
}else if(item.type == 'kkyl'){
|
||||||
|
//开卡有礼
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 参加开卡有礼活动
|
* 参加开卡有礼活动
|
||||||
@ -179,38 +164,11 @@ export default {
|
|||||||
data:dataObj
|
data:dataObj
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(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
|
this.orderInfo = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user