|
@@ -3,84 +3,37 @@
|
|
|
|
|
|
|
|
<view :style="{marginTop:'24rpx'}">
|
|
<view :style="{marginTop:'24rpx'}">
|
|
|
<scroll-view scroll-y class="scroll-Y">
|
|
<scroll-view scroll-y class="scroll-Y">
|
|
|
- <view class="flex-col outView select">
|
|
|
|
|
|
|
+ <view class="flex-col outView " :class="{select:item.select}" v-for="(item,index) in roleBindRuleList" @click="selectRule(item,index)">
|
|
|
<view class="flex-row justify-between">
|
|
<view class="flex-row justify-between">
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
|
|
+ <text class="title">{{item.title}}</text>
|
|
|
|
|
+ <u-icon name="checkbox-mark" color="#666" size="24" v-if="item.select"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="flex-row justify-between awardView">
|
|
<view class="flex-row justify-between awardView">
|
|
|
- <text>注册:</text>
|
|
|
|
|
- <view class="flex-row award ">
|
|
|
|
|
- <text class="awardItem">现金:12元</text>
|
|
|
|
|
- <text class="awardItem">比例:10%</text>
|
|
|
|
|
|
|
+ <text>直推:</text>
|
|
|
|
|
+ <view>
|
|
|
|
|
+ <view class="flex-row award ">
|
|
|
|
|
+ <text class="awardItem">注册现金:{{item.awardAmount}}元</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-row award ">
|
|
|
|
|
+ <text class="awardItem">消费现金:{{item.consumeAmount}}元</text>
|
|
|
|
|
+ <text class="awardItem">消费比例:{{item.consumeRatio * 100}}%</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="flex-col outView">
|
|
|
|
|
- <view class="flex-row justify-between">
|
|
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="flex-row justify-between awardView">
|
|
<view class="flex-row justify-between awardView">
|
|
|
- <text>注册:</text>
|
|
|
|
|
|
|
+ <text>间推:</text>
|
|
|
<view class="flex-row award ">
|
|
<view class="flex-row award ">
|
|
|
- <text class="awardItem">现金:12元</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="flex-col outView">
|
|
|
|
|
- <view class="flex-row justify-between">
|
|
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-row justify-between awardView">
|
|
|
|
|
- <text>优惠券:</text>
|
|
|
|
|
- <view class="flex-col award ">
|
|
|
|
|
- <text>数量:100张</text>
|
|
|
|
|
- <text>有效期:2024-01-01 至 2024-01-30</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-col outView select">
|
|
|
|
|
- <view class="flex-row justify-between">
|
|
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-row justify-between awardView">
|
|
|
|
|
- <text>优惠券:</text>
|
|
|
|
|
- <view class="flex-col award ">
|
|
|
|
|
- <text>数量:100张</text>
|
|
|
|
|
- <text>有效期:2024-01-01 至 2024-01-30</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-col outView">
|
|
|
|
|
- <view class="flex-row justify-between">
|
|
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-row justify-between awardView">
|
|
|
|
|
- <text>优惠券:</text>
|
|
|
|
|
- <view class="flex-col award ">
|
|
|
|
|
- <text>数量:100张</text>
|
|
|
|
|
- <text>有效期:2024-01-01 至 2024-01-30</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-col outView select">
|
|
|
|
|
- <view class="flex-row justify-between">
|
|
|
|
|
- <text class="title">规则标题</text>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#666" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-row justify-between awardView">
|
|
|
|
|
- <text>优惠券:</text>
|
|
|
|
|
- <view class="flex-col award ">
|
|
|
|
|
- <text>数量:100张</text>
|
|
|
|
|
- <text>有效期:2024-01-01 至 2024-01-30</text>
|
|
|
|
|
|
|
+ <text class="awardItem">间推现金:{{item.indirectAmount}}元</text>
|
|
|
|
|
+ <text class="awardItem">间推比例:{{item.indirectRatio * 100}}%</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <!-- <view class="flex-row justify-between awardView">-->
|
|
|
|
|
+ <!-- <text>优惠券:</text>-->
|
|
|
|
|
+ <!-- <view class="flex-col award ">-->
|
|
|
|
|
+ <!-- <text>满100减250的优惠券</text>-->
|
|
|
|
|
+ <!-- <text>有效期:2024-01-01 至 2024-01-30</text>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
|
|
+ <!-- </view>-->
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
@@ -116,7 +69,9 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- qrcodeUrl:this.$xcxUrl,
|
|
|
|
|
|
|
+ roleBindRuleList:[],
|
|
|
|
|
+ userInfo:{},
|
|
|
|
|
+ qrcodeUrl:this.$xcxUrl+'?expandUserId={expandUserId}&ruleId={ruleId}',
|
|
|
options: {
|
|
options: {
|
|
|
// 指定二维码前景,一般可在中间放logo
|
|
// 指定二维码前景,一般可在中间放logo
|
|
|
foregroundImagePadding:2,
|
|
foregroundImagePadding:2,
|
|
@@ -125,14 +80,59 @@
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- onLoad() {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.userInfo = uni.getStorageSync('spreadUserInfo')
|
|
|
|
|
+ this.getRuleByRoleId(this.userInfo.roleId)
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+
|
|
|
|
|
+ selectRule(item,index){
|
|
|
|
|
+ this.roleBindRuleList.forEach(i=>{
|
|
|
|
|
+ i.select=false
|
|
|
|
|
+ })
|
|
|
|
|
+ item.select = true
|
|
|
|
|
+ this.$set(this.roleBindRuleList,index,item)
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ //查询角色已经绑定的规则
|
|
|
|
|
+ getRuleByRoleId(roleId){
|
|
|
|
|
+ this.$api.service.getRuleByRoleId({
|
|
|
|
|
+ roleId:roleId
|
|
|
|
|
+ }).then(res=>{
|
|
|
|
|
+ this.roleBindRuleList = res.data.data
|
|
|
|
|
+ this.roleBindRuleList[0].select = true
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
createQrCode(){
|
|
createQrCode(){
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ expandUserId:this.userInfo.id,
|
|
|
|
|
+ ruleId:''
|
|
|
|
|
+ };
|
|
|
|
|
+ this.roleBindRuleList.forEach(item=>{
|
|
|
|
|
+ if (item.select){
|
|
|
|
|
+ data.ruleId= item.id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ if (!data.ruleId){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '请选择推广规则'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let key in data) {
|
|
|
|
|
+ let regexp = new RegExp("{" + key + "}"); // 构造正则表达式
|
|
|
|
|
+ this.qrcodeUrl = this.qrcodeUrl.replace(regexp, data[key]); // 执行替换操作
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('++++data+++++',data)
|
|
|
|
|
+ console.log('++++qrcodeUrl+++++',this.qrcodeUrl)
|
|
|
this.$refs.createQrCodePopup.open()
|
|
this.$refs.createQrCodePopup.open()
|
|
|
},
|
|
},
|
|
|
closePopup(){
|
|
closePopup(){
|
|
|
|
|
+ this.qrcodeUrl=this.$xcxUrl+'?expandUserId={expandUserId}&ruleId={ruleId}',
|
|
|
this.$refs.createQrCodePopup.close()
|
|
this.$refs.createQrCodePopup.close()
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|