Merge branch 'dev' into prod
This commit is contained in:
commit
a8e6bb0352
|
@ -1 +0,0 @@
|
|||
.main-title-color[data-v-07850ae0]{color:#d14328}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
.main-title-color[data-v-cc0dc560]{color:#d14328}
|
|
@ -0,0 +1 @@
|
|||
var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,l=(e,a,n)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,i=(t,e)=>{for(var a in e||(e={}))o.call(e,a)&&l(t,a,e[a]);if(n)for(var a of n(e))s.call(e,a)&&l(t,a,e[a]);return t},r=(t,n)=>e(t,a(n)),c=(t,e,a)=>new Promise(((n,o)=>{var s=t=>{try{i(a.next(t))}catch(e){o(e)}},l=t=>{try{i(a.throw(t))}catch(e){o(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(s,l);i((a=a.apply(t,e)).next())}));import{r as u,s as d,d as p,g as v,a as y,b as f,u as m,n as _,c as g,o as O,e as b,f as h,h as w,i as j,w as I,j as x,k,l as P,m as $,p as T,q as D,_ as L}from"./index-DLP_m7Cj.js";const C=t=>new Promise(((e,a)=>{u(r(i({},t),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(t){var n,o,s;(null==(n=t.data)?void 0:n.code)>=200&&(null==(o=t.data)?void 0:o.code)<300?e(t.data):401===(null==(s=t.data)?void 0:s.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(t)):e(t.data)},fail(t){d({icon:"none",title:"网络错误,换个网络试试"}),a(t)}}))}));C.get=(t,e)=>C({url:t,query:e,method:"GET"}),C.post=(t,e,a,n=!1)=>C({url:t,query:a,data:e,method:"POST",hideErrorToast:n});const E=t=>C.get("/v1/content",t),S=L(p(r(i({},{name:"Home"}),{__name:"index",setup(t){const{safeAreaInsets:e}=v(),a=y({}),n=f(""),o=f(""),s=m();let l="activity",i=null;const r={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},u=y({url:"",title:""});function p(){return c(this,null,(function*(){const t={};t[r[l]]=n.value||"",s.reset();L(yield E(t))}))}function L(t){if(200===t.code){const{login_content_template:e,login_content_templates:l,content_templates:i,token:r}=t.data;n.value=t.data.activity_code,Object.assign(a,t.data),1===e.validate_login?Object.assign(u,{url:C(l.source+`?activity_code=${n.value}`),title:l.moduledesc}):2===e.validate_login&&Object.assign(u,{url:C(i.source+`?activity_code=${n.value}&token=${r}`),title:i.moduledesc}),g({title:u.title}),s.setUserInfo({srcList:u,contentData:a,activityCode:n.value,token:r,lottery:o.value})}else d({title:t.message,icon:"none"})}function C(t){const e=(new Date).getTime();return t+(t.includes("?")?"×tamp=":"?timestamp=")+e}window.parent.addEventListener("message",(function(t){let e={url:"",title:""};switch(t.data.data.type){case"login":case"couponBack":e={url:a.content_templates.source+`?activity_code=${n.value}`,title:a.content_templates.moduledesc};break;case"coupon":e={url:a.user_content_templates.source+`?activity_code=${n.value}`,title:a.user_content_templates.moduledesc};break;case"product":const o=`product_id=${t.data.data.product_id}&id=${t.data.data.id}&activity_code=${n.value}`,s=encodeURIComponent(o);e={url:a.user_content_templates.source+`#/pages/coupon/product?url=${s}`,title:a.user_content_templates.moduledesc};break;case"logout":return p()}_((()=>{Object.assign(u,{url:C(e.url),title:e.title}),g({title:u.title}),s.setUserInfo({srcList:u,contentData:a,activityCode:n.value,token:a.token,lottery:o.value})}))}));const S=()=>{i=setInterval((()=>c(this,null,(function*(){const t={};t[r[l]]=o.value||"";const e=yield E(t);JSON.stringify(e.data)!==JSON.stringify(s.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),L(e))}))),6e4)};return O((()=>{n.value=(()=>{const t=window.location.href;if(-1!==t.indexOf("#/")){let e="";const a=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("/")[t.split("/").length-1];return e=-1===a.indexOf("/")?a||"":a.split("/")[0],-1===e.indexOf("-")?l="activity":(l=e.split("-")[0],e=e.split("-")[1]),e}if(-1!==t.indexOf("?")){let e="";return e=t.split("=")[1],l=e.split("-")[0],e.split("-")[1]}{const e=t.split("/"),a=e[e.length-1];let n="";return-1===a.indexOf("-")?(n=a,l="activity"):(l=a.split("-")[0],n=a.split("-")[1]),n}})(),o.value=n.value,!s.userInfo.srcList.url||s.userInfo.lottery!==o.value&&s.userInfo.activityCode!==n.value?p():(n.value=s.userInfo.activityCode,Object.assign(u,s.userInfo.srcList,{url:C(s.userInfo.srcList.url)}),Object.assign(a,s.userInfo.contentData),g({title:u.title})),S()})),b((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,o=D,s=h("layout-default-uni");return w(),j(s,null,{default:I((()=>{var t;return[x(o,{class:"bg-white overflow-hidden pt-2 px-4",style:$({marginTop:(null==(t=k(e))?void 0:t.top)+"px"})},{default:I((()=>[k(u).url?(w(),j(n,{key:0,src:k(u).url},null,8,["src"])):P("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-cc0dc560"]]);export{S as default};
|
|
@ -1 +0,0 @@
|
|||
var t=Object.defineProperty,e=Object.defineProperties,a=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(e,a,n)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,i=(t,e)=>{for(var a in e||(e={}))s.call(e,a)&&l(t,a,e[a]);if(n)for(var a of n(e))o.call(e,a)&&l(t,a,e[a]);return t},r=(t,n)=>e(t,a(n)),c=(t,e,a)=>new Promise(((n,s)=>{var o=t=>{try{i(a.next(t))}catch(e){s(e)}},l=t=>{try{i(a.throw(t))}catch(e){s(e)}},i=t=>t.done?n(t.value):Promise.resolve(t.value).then(o,l);i((a=a.apply(t,e)).next())}));import{r as u,s as d,d as p,g as v,a as f,b as y,u as m,n as _,c as g,o as O,e as b,f as h,h as w,i as j,w as I,j as x,k,l as P,m as $,p as T,q,_ as D}from"./index-Dm41iOPZ.js";const L=t=>new Promise(((e,a)=>{u(r(i({},t),{dataType:"json",header:{"content-type":"application/json"},responseType:"json",success(t){var n,s,o;(null==(n=t.data)?void 0:n.code)>=200&&(null==(s=t.data)?void 0:s.code)<300?e(t.data):401===(null==(o=t.data)?void 0:o.code)?(window.parent.postMessage({data:{type:"logout"}},"*"),a(t)):e(t.data)},fail(t){d({icon:"none",title:"网络错误,换个网络试试"}),a(t)}}))}));L.get=(t,e)=>L({url:t,query:e,method:"GET"}),L.post=(t,e,a,n=!1)=>L({url:t,query:a,data:e,method:"POST",hideErrorToast:n});const E=t=>L.get("/v1/content",t),S=D(p(r(i({},{name:"Home"}),{__name:"index",setup(t){const{safeAreaInsets:e}=v(),a=f({}),n=y(""),s=y(""),o=m();let l="activity",i=null;const r={Interface:"api_code",lottery:"lottery_code",activity:"activity_code"},u=f({url:"",title:""});function p(){return c(this,null,(function*(){const t={};t[r[l]]=n.value||"",o.reset();D(yield E(t))}))}function D(t){if(200===t.code){const{login_content_template:e,login_content_templates:s,content_templates:l,token:i}=t.data;n.value=t.data.activity_code,Object.assign(a,t.data),1===e.validate_login?Object.assign(u,{url:L(s.source+`?activity_code=${n.value}`),title:s.moduledesc}):2===e.validate_login&&Object.assign(u,{url:L(l.source+`?activity_code=${n.value}&token=${i}`),title:l.moduledesc}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:i})}else d({title:t.message,icon:"none"})}function L(t){const e=(new Date).getTime();return t+(t.includes("?")?"×tamp=":"?timestamp=")+e}window.parent.addEventListener("message",(function(t){let e={url:"",title:""};switch(t.data.data.type){case"login":case"couponBack":e={url:a.content_templates.source+`?activity_code=${n.value}`,title:a.content_templates.moduledesc};break;case"coupon":e={url:a.user_content_templates.source+`?activity_code=${n.value}`,title:a.user_content_templates.moduledesc};break;case"product":const s=`product_id=${t.data.data.product_id}&id=${t.data.data.id}&activity_code=${n.value}`,o=encodeURIComponent(s);e={url:a.user_content_templates.source+`#/pages/coupon/product?url=${o}`,title:a.user_content_templates.moduledesc};break;case"logout":return p()}_((()=>{Object.assign(u,{url:L(e.url),title:e.title}),g({title:u.title}),o.setUserInfo({srcList:u,contentData:a,query:n.value,token:a.token})}))}));const S=()=>{i=setInterval((()=>c(this,null,(function*(){const t={};t[r[l]]=s.value||"";const e=yield E(t);JSON.stringify(e.data)!==JSON.stringify(o.userInfo.contentData)&&(d({title:"活动发生变更",icon:"none"}),D(e))}))),6e4)};return O((()=>{n.value=(()=>{const t=window.location.href;if(-1!==t.indexOf("#/")){let e="";const a=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("/")[t.split("/").length-1];return e=-1===a.indexOf("/")?a||"":a.split("/")[0],-1===e.indexOf("-")?l="activity":(l=e.split("-")[0],e=e.split("-")[1]),e}if(-1!==t.indexOf("?")){let e="";return e=t.split("=")[1],l=e.split("-")[0],e.split("-")[1]}{const e=t.split("/"),a=e[e.length-1];let n="";return-1===a.indexOf("-")?(n=a,l="activity"):(l=a.split("-")[0],n=a.split("-")[1]),n}})(),s.value=n.value,o.userInfo.srcList.url&&o.userInfo.query===n.value?(Object.assign(u,o.userInfo.srcList,{url:L(o.userInfo.srcList.url)}),Object.assign(a,o.userInfo.contentData),g({title:u.title})):p(),S()})),b((()=>{clearInterval(i),i=null})),(t,a)=>{const n=T,s=q,o=h("layout-default-uni");return w(),j(o,null,{default:I((()=>{var t;return[x(s,{class:"bg-white overflow-hidden pt-2 px-4",style:$({marginTop:(null==(t=k(e))?void 0:t.top)+"px"})},{default:I((()=>[k(u).url?(w(),j(n,{key:0,src:k(u).url},null,8,["src"])):P("",!0)])),_:1},8,["style"])]})),_:1})}}})),[["__scopeId","data-v-07850ae0"]]);export{S as default};
|
|
@ -1,6 +1,7 @@
|
|||
<!doctype html>
|
||||
<html build-date="2024-07-02 18:53:21">
|
||||
<head>
|
||||
<html build-date="2024-07-10 11:36:57">
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
|
@ -15,15 +16,20 @@
|
|||
(coverSupport ? ', viewport-fit=cover' : '') +
|
||||
'" />',
|
||||
)
|
||||
|
||||
</script>
|
||||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-Dm41iOPZ.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-DLP_m7Cj.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css">
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<!--app-html-->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -316,6 +316,20 @@ const flip = debounce(function (index) {
|
|||
})
|
||||
return
|
||||
}
|
||||
if (cardStateArray.length === 0 || cardStateArray.length === 1) {
|
||||
uni.showToast({
|
||||
title: '无抽奖商品',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (status.value !== 2) {
|
||||
uni.showToast({
|
||||
title: '活动异常',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (
|
||||
// eslint-disable-next-line camelcase
|
||||
receive_num.value > 0 ||
|
||||
|
@ -364,10 +378,12 @@ function getAccountInfo() {
|
|||
}
|
||||
Api.getCode(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
status.value = res.data.status
|
||||
status.value = res.data.activity_info?.status || 0
|
||||
// eslint-disable-next-line camelcase
|
||||
receive_num.value = res.data.lottery_count - res.data.use_lottery_count
|
||||
// eslint-disable-next-line camelcase
|
||||
receive_num.value = receive_num.value > 0 ? receive_num.value : 0
|
||||
// eslint-disable-next-line camelcase
|
||||
lottery_code.value = res.data.lottery_code
|
||||
// eslint-disable-next-line camelcase
|
||||
validate_whitelist.value = res.data.validate_whitelist
|
||||
|
|
|
@ -27,7 +27,7 @@ defineOptions({
|
|||
// 获取屏幕边界到安全区域距离
|
||||
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||
const contentData = reactive<any>({})
|
||||
const query = ref<string>('')
|
||||
const activityCode = ref<string>('')
|
||||
const lottery = ref<string>('')
|
||||
// const activityCode = ref<string>('')
|
||||
const useStore = useUserStore()
|
||||
|
@ -88,91 +88,46 @@ const getUrlPathName = () => {
|
|||
}
|
||||
|
||||
window.parent.addEventListener('message', function (event) {
|
||||
let srcData = {
|
||||
url: '',
|
||||
title: '',
|
||||
}
|
||||
switch (event.data.data.type) {
|
||||
case 'login':
|
||||
srcData = {
|
||||
url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
title: contentData.content_templates.moduledesc,
|
||||
}
|
||||
case 'couponBack':
|
||||
srcList.url = contentData.content_templates.source + `?activity_code=${activityCode.value}`
|
||||
srcList.title = contentData.content_templates.moduledesc
|
||||
break
|
||||
case 'coupon':
|
||||
srcData = {
|
||||
url: contentData.user_content_templates.source + `?activity_code=${query.value}`,
|
||||
title: contentData.user_content_templates.moduledesc,
|
||||
}
|
||||
srcList.url =
|
||||
contentData.user_content_templates.source + `?activity_code=${activityCode.value}`
|
||||
srcList.title = contentData.user_content_templates.moduledesc
|
||||
break
|
||||
case 'product':
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const url = `product_id=${event.data.data.product_id}&id=${event.data.data.id}&activity_code=${query.value}`
|
||||
// eslint-disable-next-line no-case-declarations
|
||||
const newUrl = encodeURIComponent(url)
|
||||
srcData = {
|
||||
url: contentData.user_content_templates.source + `#/pages/coupon/product?url=${newUrl}`,
|
||||
title: contentData.user_content_templates.moduledesc,
|
||||
}
|
||||
break
|
||||
case 'couponBack':
|
||||
srcData = {
|
||||
url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
title: contentData.content_templates.moduledesc,
|
||||
}
|
||||
const url = `product_id=${event.data.data.product_id}&id=${event.data.data.id}&activity_code=${activityCode.value}`
|
||||
srcList.url =
|
||||
contentData.user_content_templates.source +
|
||||
`#/pages/coupon/product?url=${encodeURIComponent(url)}`
|
||||
srcList.title = contentData.user_content_templates.moduledesc
|
||||
break
|
||||
case 'logout':
|
||||
return initContent()
|
||||
}
|
||||
// if (event.data.data.type === 'login') {
|
||||
// srcData = {
|
||||
// url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
// title: contentData.content_templates.moduledesc,
|
||||
// }
|
||||
// } else if (event.data.data.type === 'coupon') {
|
||||
// srcData = {
|
||||
// url: contentData.user_content_templates.source + `?activity_code=${query.value}`,
|
||||
// title: contentData.user_content_templates.moduledesc,
|
||||
// }
|
||||
// } else if (event.data.data.type === 'product') {
|
||||
// const url = `product_id=${event.data.data.product_id}&id=${event.data.data.id}&activity_code=${query.value}`
|
||||
// const newUrl = encodeURIComponent(url)
|
||||
// srcData = {
|
||||
// url: contentData.user_content_templates.source + `#/pages/coupon/product?url=${newUrl}`,
|
||||
// title: contentData.user_content_templates.moduledesc,
|
||||
// }
|
||||
// } else if (event.data.data.type === 'couponBack') {
|
||||
// srcData = {
|
||||
// url: contentData.content_templates.source + `?activity_code=${query.value}`,
|
||||
// title: contentData.content_templates.moduledesc,
|
||||
// }
|
||||
// } else if (event.data.data.type === 'logout') {
|
||||
// return initContent()
|
||||
// // srcData = {
|
||||
// // url: contentData.login_content_templates.source,
|
||||
// // title: contentData.login_content_templates.moduledesc,
|
||||
// // }
|
||||
// }
|
||||
nextTick(() => {
|
||||
Object.assign(srcList, {
|
||||
url: getTimesTamp(srcData.url),
|
||||
title: srcData.title,
|
||||
})
|
||||
srcList.url = getTimesTamp(srcList.url)
|
||||
uni.setNavigationBarTitle({
|
||||
title: srcList.title,
|
||||
})
|
||||
useStore.setUserInfo({
|
||||
srcList,
|
||||
contentData,
|
||||
query: query.value,
|
||||
activityCode: activityCode.value,
|
||||
token: contentData.token,
|
||||
lottery: lottery.value,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
async function initContent() {
|
||||
const params = {}
|
||||
params[codeType[code]] = query.value || ''
|
||||
params[codeType[code]] = activityCode.value || ''
|
||||
useStore.reset()
|
||||
const res: any = await getContent(params)
|
||||
initData(res)
|
||||
|
@ -186,20 +141,18 @@ function initData(res) {
|
|||
content_templates: baseUrl,
|
||||
token,
|
||||
} = res.data
|
||||
query.value = res.data.activity_code
|
||||
activityCode.value = res.data.activity_code
|
||||
Object.assign(contentData, res.data)
|
||||
if (loginValid.validate_login === 1) {
|
||||
// activity_code 方式
|
||||
Object.assign(srcList, {
|
||||
url: getTimesTamp(login.source + `?activity_code=${query.value}`),
|
||||
title: login.moduledesc,
|
||||
})
|
||||
srcList.url = getTimesTamp(login.source + `?activity_code=${activityCode.value}`)
|
||||
srcList.title = login.moduledesc
|
||||
} else if (loginValid.validate_login === 2) {
|
||||
// api_code 方式
|
||||
Object.assign(srcList, {
|
||||
url: getTimesTamp(baseUrl.source + `?activity_code=${query.value}&token=${token}`),
|
||||
title: baseUrl.moduledesc,
|
||||
})
|
||||
srcList.url = getTimesTamp(
|
||||
baseUrl.source + `?activity_code=${activityCode.value}&token=${token}`,
|
||||
)
|
||||
srcList.title = baseUrl.moduledesc
|
||||
}
|
||||
uni.setNavigationBarTitle({
|
||||
title: srcList.title,
|
||||
|
@ -207,8 +160,9 @@ function initData(res) {
|
|||
useStore.setUserInfo({
|
||||
srcList,
|
||||
contentData,
|
||||
query: query.value,
|
||||
activityCode: activityCode.value,
|
||||
token,
|
||||
lottery: lottery.value,
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
|
@ -239,15 +193,22 @@ const intervalData = () => {
|
|||
}
|
||||
|
||||
onLoad(() => {
|
||||
query.value = getUrlPathName()
|
||||
lottery.value = query.value
|
||||
if (!useStore.userInfo.srcList.url || useStore.userInfo.query !== query.value) {
|
||||
const {
|
||||
srcList: srcListU,
|
||||
lottery: lotteryU,
|
||||
activityCode: activityCodeU,
|
||||
contentData: contentDataU,
|
||||
} = useStore.userInfo
|
||||
activityCode.value = getUrlPathName()
|
||||
lottery.value = activityCode.value
|
||||
if (!srcListU.url || (lotteryU !== lottery.value && activityCodeU !== activityCode.value)) {
|
||||
initContent()
|
||||
} else {
|
||||
Object.assign(srcList, useStore.userInfo.srcList, {
|
||||
url: getTimesTamp(useStore.userInfo.srcList.url),
|
||||
activityCode.value = activityCodeU
|
||||
Object.assign(srcList, srcListU, {
|
||||
url: getTimesTamp(srcListU.url),
|
||||
})
|
||||
Object.assign(contentData, useStore.userInfo.contentData)
|
||||
Object.assign(contentData, contentDataU)
|
||||
uni.setNavigationBarTitle({
|
||||
title: srcList.title,
|
||||
})
|
||||
|
|
|
@ -14,14 +14,10 @@
|
|||
<view class="mk2 plr50 flex_column flex_items" style="">
|
||||
<view class="flex_between flex_items" style="width: 100%">
|
||||
<text style="opacity: 0">站位</text>
|
||||
<text v-if="isz == 1" class="f36 bold" style="margin-top: a1e0 rpx; color: #003a6e">
|
||||
<text v-if="isz == 1" class="f36 bold" style="margin-top: 100rpx; color: #003a6e">
|
||||
恭喜您获得
|
||||
</text>
|
||||
<text
|
||||
v-if="isz == 0"
|
||||
class="f36 bold"
|
||||
style="margin-top: a1e0 rpx; color: #003a6e"
|
||||
></text>
|
||||
<text v-if="isz == 0" class="f36 bold" style="margin-top: 100rpx; color: #003a6e"></text>
|
||||
<image
|
||||
src="../../static/images/turntable/guan.png"
|
||||
@click="closemsk"
|
||||
|
@ -29,8 +25,8 @@
|
|||
mode=""
|
||||
></image>
|
||||
</view>
|
||||
<text class="f40 mt20" style="color: #003a6e">{{ jiang }}</text>
|
||||
<text class="f24 mt10" style="color: #003a6e">请到【我的奖品】中查看</text>
|
||||
<text class="f40 mt40" style="color: #003a6e">{{ jiang }}</text>
|
||||
<text v-if="isz === 1" class="f24 mt10" style="color: #003a6e">请到【我的奖品】中查看</text>
|
||||
<view
|
||||
v-if="isz == 1"
|
||||
@click="mypre"
|
||||
|
@ -237,11 +233,11 @@ export default {
|
|||
},
|
||||
// 活动活动配置信息
|
||||
getConfig() {
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
})
|
||||
// uni.showLoading({
|
||||
// title: '加载中...',
|
||||
// })
|
||||
const params = {
|
||||
activity_code: this.activity_code,
|
||||
activity_code: this.activity_code || 'zgp',
|
||||
}
|
||||
Api.getCode(params).then((res) => {
|
||||
uni.hideLoading()
|
||||
|
@ -250,7 +246,9 @@ export default {
|
|||
const { activity_info, status, lottery_code, lottery_count, use_lottery_count } = res.data
|
||||
// eslint-disable-next-line camelcase
|
||||
this.freeNum = lottery_count - use_lottery_count
|
||||
this.status = status
|
||||
this.freeNum = this.freeNum > 0 ? this.freeNum : 0
|
||||
// eslint-disable-next-line camelcase
|
||||
this.status = activity_info?.status || 0
|
||||
// eslint-disable-next-line camelcase
|
||||
this.lottery_code = lottery_code
|
||||
// eslint-disable-next-line camelcase
|
||||
|
@ -274,7 +272,7 @@ export default {
|
|||
// 获取奖品列表
|
||||
getPrizeList() {
|
||||
Api.getProducts({
|
||||
activity_code: this.activity_code,
|
||||
activity_code: this.activity_code || 'zgp',
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { products } = res.data
|
||||
|
@ -330,6 +328,7 @@ export default {
|
|||
lottery_code: this.lottery_code,
|
||||
}
|
||||
if (this.status === 1 || this.status === 5) {
|
||||
this.prizeing = false
|
||||
uni.showToast({
|
||||
title: '活动未开始',
|
||||
icon: 'error',
|
||||
|
@ -337,12 +336,29 @@ export default {
|
|||
return
|
||||
}
|
||||
if (this.status === 3 || this.status === 4) {
|
||||
this.prizeing = false
|
||||
uni.showToast({
|
||||
title: '活动已结束',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.prizeList.length === 0 || this.prizeList.length === 1) {
|
||||
this.prizeing = false
|
||||
uni.showToast({
|
||||
title: '无抽奖商品',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.status !== 2) {
|
||||
this.prizeing = false
|
||||
uni.showToast({
|
||||
title: '活动异常',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
Api.lottery(params)
|
||||
.then((res) => {
|
||||
this.freeNum = res.data.lottery_count
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</view>
|
||||
<view class="flex_start flex_items mr20" style="color: #eb5e42">
|
||||
<view class="f24">¥</view>
|
||||
<text class="f48 bolder one">{{ item.show_price }}</text>
|
||||
<text class="f48 bolder one">{{ item.amount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt40 flex_between flex_items">
|
||||
|
@ -87,7 +87,11 @@
|
|||
</view>
|
||||
<view
|
||||
@click="gomypre(item)"
|
||||
class="f24 f-center"
|
||||
:class="[
|
||||
'f24',
|
||||
'f-center',
|
||||
item.status === 2 && item.product_form === 2 && 'not-view',
|
||||
]"
|
||||
style="
|
||||
width: 124rpx;
|
||||
line-height: 48rpx;
|
||||
|
@ -111,7 +115,6 @@
|
|||
>
|
||||
<text>--暂无数据--</text>
|
||||
</view>
|
||||
<Ywatermark :info="'蓝色兄弟'"></Ywatermark>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -119,9 +122,10 @@
|
|||
import api, { imgUrl } from './api'
|
||||
|
||||
const istrue = ref<boolean>(false)
|
||||
const isShow = ref<boolean>(false)
|
||||
const list = reactive<any>([])
|
||||
const query = reactive<any>({
|
||||
activity_code: 'quanyi',
|
||||
activity_code: 'zgp',
|
||||
})
|
||||
|
||||
const dui = (item) => {
|
||||
|
@ -134,14 +138,32 @@ const dui = (item) => {
|
|||
const gomypre = (idx) => {
|
||||
if (idx.status === 1) {
|
||||
const url =
|
||||
'product_id=' + idx.product_id + '&id=' + idx.id + '&activity_code=' + query.activity_code
|
||||
'product_id=' +
|
||||
idx.product_id +
|
||||
'&id=' +
|
||||
idx.id +
|
||||
'&activity_code=' +
|
||||
query.activity_code +
|
||||
'&mobile=' +
|
||||
idx.mobile +
|
||||
'&account_type=' +
|
||||
idx.account_type +
|
||||
'&product_form=' +
|
||||
idx.product_form
|
||||
const newUrl = encodeURIComponent(url)
|
||||
uni.navigateTo({
|
||||
url: '/pages/tt-coupon/product?url=' + newUrl,
|
||||
})
|
||||
} else {
|
||||
if (idx.product_form === 3) {
|
||||
uni.showModal({
|
||||
content: `卡密:${idx.order_info}`,
|
||||
showCancel: false,
|
||||
})
|
||||
} else if (idx.product_form === 1) {
|
||||
idx.order_info && window.open(idx.order_info)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getData() {
|
||||
|
@ -219,7 +241,9 @@ onLoad(() => {
|
|||
page {
|
||||
background: #f5f5f5 !important;
|
||||
}
|
||||
|
||||
.not-view {
|
||||
background: #848486 !important;
|
||||
}
|
||||
.three {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -340,13 +340,22 @@ function chosem(index) {
|
|||
curindex.value = index
|
||||
}
|
||||
function okdiu() {
|
||||
const params = { id: Number(id.value) }
|
||||
const params = {
|
||||
id: Number(id.value),
|
||||
account: route.mobile,
|
||||
account_type: route.product_form === 2 ? route.account_type : undefined,
|
||||
}
|
||||
api.exchange(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
uni.hideLoading()
|
||||
uni.navigateTo({
|
||||
url: '/pages/tt-coupon/prizes?activity_code=' + route.activity_code,
|
||||
uni.showToast({
|
||||
title: '兑换成功',
|
||||
icon: 'success',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/tt-coupon/index?activity_code=' + route.activity_code,
|
||||
})
|
||||
}, 500)
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
|
|
|
@ -77,16 +77,22 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex_items flex_center" style="width: 100%">
|
||||
<view v-if="info.product_form !== 3" class="flex_items flex_center" style="width: 100%">
|
||||
<view
|
||||
class="bgwhite pb30 plr20 pt20 mt35 flex_column"
|
||||
style="width: calc(100% - 100rpx); border-radius: 20rpx"
|
||||
>
|
||||
<text class="f30 mt30 bold" style="color: #333">待充账号</text>
|
||||
<text class="f30 mt30 bold" style="color: #333">充值账号</text>
|
||||
<wd-input
|
||||
class="mt30"
|
||||
fontSize="14"
|
||||
placeholder="请输入手机号"
|
||||
:placeholder="
|
||||
info.account_type === 1
|
||||
? '请输入手机号'
|
||||
: info.account_type === 2
|
||||
? '请输入QQ'
|
||||
: '请输入充值账号'
|
||||
"
|
||||
v-model="info.mobile"
|
||||
></wd-input>
|
||||
<text class="f26 mt40" style="color: #4d4d4d">温馨提示</text>
|
||||
|
@ -138,7 +144,13 @@ function dui() {
|
|||
uni.showLoading({
|
||||
title: '兑换中...',
|
||||
})
|
||||
const params = { id: info.id }
|
||||
if (info.product_form !== 3 && !info.mobile) {
|
||||
return uni.showToast({
|
||||
title: '请输入充值账号',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
const params = { id: info.id, account: info.mobile, account_type: info.account_type }
|
||||
api.exchange(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
ismask.value = true
|
||||
|
|
|
@ -4,11 +4,11 @@ import { createPersistedState } from 'pinia-plugin-persistedstate' // 数据持
|
|||
const store = createPinia()
|
||||
store.use(
|
||||
createPersistedState({
|
||||
storage: sessionStorage,
|
||||
// storage: {
|
||||
// getItem: uni.getStorageSync,
|
||||
// setItem: uni.setStorageSync,
|
||||
// },
|
||||
// storage: sessionStorage,
|
||||
storage: {
|
||||
getItem: uni.getStorageSync,
|
||||
setItem: uni.setStorageSync,
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ import { ref } from 'vue'
|
|||
|
||||
const initState = {
|
||||
nickname: '',
|
||||
query: '',
|
||||
activityCode: '',
|
||||
token: '',
|
||||
href: '',
|
||||
lottery: '',
|
||||
srcList: { url: '' },
|
||||
contentData: {},
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ type IUserInfo = {
|
|||
token?: string
|
||||
srcList?: SrcListType
|
||||
contentData?: object
|
||||
query?: string
|
||||
href?: string
|
||||
activityCode?: string
|
||||
lottery?: string
|
||||
}
|
||||
|
||||
enum TestEnum {
|
||||
|
|
Loading…
Reference in New Issue