|
|
|
@ -7,13 +7,13 @@ |
|
|
|
/> |
|
|
|
<view class="flex-col section_2"> |
|
|
|
<view class="flex-col items-center section_3"> |
|
|
|
<text class="text_2">783489248292</text> |
|
|
|
<text class="text_3">有效期:2022-05-17至2022-05-31</text> |
|
|
|
<text class="text_2">{{userData.agent_code}}</text> |
|
|
|
<text class="text_3">有效期:{{unixTimeFormat(userData.start_time)}} 至 {{unixTimeFormat(userData.end_time)}}</text> |
|
|
|
</view> |
|
|
|
<text class="text_4">注:重新生成后没使用的优惠码将失效</text> |
|
|
|
<view class="flex-col group_6"> |
|
|
|
<view class="flex-col items-center button" @click="copy()"><text class="text_5">复制分销优惠码</text></view> |
|
|
|
<view class="flex-col items-center button_1"><text class="text_6">重新生成优惠码</text></view> |
|
|
|
<view class="flex-col items-center button_1" @click="refreshCode()"><text class="text_6">重新生成优惠码</text></view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -22,17 +22,31 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { couponSearch,couponUpdate } from '@/service/index.js'; |
|
|
|
import { dateFormat } from '@/common/dateFtt.js'; |
|
|
|
export default { |
|
|
|
|
|
|
|
data(){ |
|
|
|
return { |
|
|
|
userData:null |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad() { |
|
|
|
|
|
|
|
couponSearch({}).then((res)=>{ |
|
|
|
this.userData = res.data.datas |
|
|
|
console.log("couponSearch",res); |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
unixTimeFormat(t){ |
|
|
|
return dateFormat(new Date(t*1000),'yyyy-MM-dd') |
|
|
|
}, |
|
|
|
copy(){ |
|
|
|
let userInfo = uni.getStorageSync('userInfo'); |
|
|
|
console.log(11111); |
|
|
|
uni.setClipboardData({ |
|
|
|
data:userInfo.agent_code, |
|
|
|
data:this.userData.agent_code, |
|
|
|
showToast:true, |
|
|
|
success() { |
|
|
|
uni.showToast({ |
|
|
|
@ -41,6 +55,12 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
refreshCode(){ |
|
|
|
couponUpdate({}).then((res)=>{ |
|
|
|
this.userData = res.data.datas |
|
|
|
console.log("couponUpdate",res); |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|