Compare commits
6 Commits
fc2236c173
...
032133dc4d
Author | SHA1 | Date |
---|---|---|
lf | 032133dc4d | |
lf | 8d5e030157 | |
lf | e6cfb6bfa3 | |
lf | 10d01e99a8 | |
lf | 6fae9efdd2 | |
lf | 0008f6d826 |
|
@ -41,7 +41,8 @@
|
|||
## 📂 快速开始
|
||||
|
||||
main 纯洁分支
|
||||
dev 开发分支
|
||||
dev 开发分支 线上测试
|
||||
prod 正式环境 merge dev
|
||||
|
||||
执行 `pnpm create unibest` 创建项目
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
.main-title-color[data-v-07850ae0]{color:#d14328}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
.main-title-color[data-v-ba967817]{color:#d14328}
|
|
@ -1 +1 @@
|
|||
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 y,b as f,u as m,n as _,c as g,o as b,e as O,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-puNGKWFH.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=y({}),n=f(""),s=f(""),o=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||"",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:u.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 b((()=>{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}{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()})),O((()=>{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-ba967817"]]);export{S as default};
|
||||
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,7 +1,7 @@
|
|||
<!doctype html>
|
||||
<html build-date="2024-06-28 10:40:07">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css">
|
||||
<link rel="stylesheet" href="./assets/uni.ad4bcb33.css" />
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<!-- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> -->
|
||||
|
@ -16,11 +16,11 @@
|
|||
'" />',
|
||||
)
|
||||
</script>
|
||||
<title>unibest</title>
|
||||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-puNGKWFH.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css">
|
||||
<script type="module" crossorigin src="./assets/index-Dm41iOPZ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DfE4H0b6.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
VITE_APP_TITLE = 'unibest'
|
||||
VITE_APP_TITLE = '场景营销'
|
||||
VITE_APP_PORT = 9000
|
||||
|
||||
VITE_UNI_APPID = 'H57F2ACE4'
|
||||
|
@ -10,6 +10,10 @@ VITE_APP_PUBLIC_BASE = './'
|
|||
# VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
|
||||
# 正式环境
|
||||
VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
|
||||
# 曾徐平
|
||||
# VITE_SERVER_BASEURL = 'http://192.168.110.128:8081'
|
||||
# 正式环境
|
||||
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
|
||||
|
||||
VITE_UPLOAD_BASEURL = 'https://ukw0y1.laf.run/upload'
|
||||
|
||||
|
|
|
@ -7,12 +7,12 @@ VITE_SHOW_SOURCEMAP = false
|
|||
|
||||
VITE_APP_PUBLIC_BASE = ./
|
||||
# 测试线上
|
||||
# VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
|
||||
VITE_SERVER_BASEURL = 'https://gateway.dev.cdlsxd.cn'
|
||||
# 正式环境
|
||||
VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
|
||||
# VITE_SERVER_BASEURL = 'https://scens.h5.86698.cn'
|
||||
|
||||
VITE_APP_PROXY = true
|
||||
# 测试线上
|
||||
# VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
|
||||
VITE_APP_PROXY_PREFIX = 'https://gateway.dev.cdlsxd.cn'
|
||||
# 正式环境
|
||||
VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'
|
||||
# VITE_APP_PROXY_PREFIX = 'https://scens.h5.86698.cn'
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
'" />',
|
||||
)
|
||||
</script>
|
||||
<title>unibest</title>
|
||||
<title>场景营销</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
|
|||
export default defineUniPages({
|
||||
globalStyle: {
|
||||
navigationStyle: 'default',
|
||||
navigationBarTitleText: 'unibest',
|
||||
navigationBarTitleText: '场景营销',
|
||||
navigationBarBackgroundColor: '#f8f8f8',
|
||||
navigationBarTextStyle: 'black',
|
||||
backgroundColor: '#FFFFFF',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "unibest",
|
||||
"name": "场景营销",
|
||||
"appid": "H57F2ACE4",
|
||||
"description": "",
|
||||
"versionName": "1.0.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"globalStyle": {
|
||||
"navigationStyle": "default",
|
||||
"navigationBarTitleText": "unibest",
|
||||
"navigationBarTitleText": "场景营销",
|
||||
"navigationBarBackgroundColor": "#f8f8f8",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
|
|
|
@ -147,7 +147,7 @@ function gook() {
|
|||
}
|
||||
function cancle(types) {
|
||||
const tt = {
|
||||
types: '',
|
||||
types: 'go',
|
||||
show: false,
|
||||
}
|
||||
// eslint-disable-next-line eqeqeq
|
||||
|
|
|
@ -242,6 +242,7 @@ const zjtitle = ref<string>('')
|
|||
const cardStateArray = reactive([])
|
||||
const useStore = useUserStore()
|
||||
const isStatus = ref<boolean>(false)
|
||||
const status = ref<number>(null)
|
||||
|
||||
const getUrlParm = () => {
|
||||
const url = window.location.href
|
||||
|
@ -301,6 +302,20 @@ const flip = debounce(function (index) {
|
|||
})
|
||||
return
|
||||
}
|
||||
if (status.value === 1 || status.value === 5) {
|
||||
uni.showToast({
|
||||
title: '活动未开始',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (status.value === 3 || status.value === 4) {
|
||||
uni.showToast({
|
||||
title: '活动已结束',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (
|
||||
// eslint-disable-next-line camelcase
|
||||
receive_num.value > 0 ||
|
||||
|
@ -349,6 +364,7 @@ function getAccountInfo() {
|
|||
}
|
||||
Api.getCode(params).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
status.value = res.data.status
|
||||
// eslint-disable-next-line camelcase
|
||||
receive_num.value = res.data.lottery_count - res.data.use_lottery_count
|
||||
// eslint-disable-next-line camelcase
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
}
|
||||
"
|
||||
>
|
||||
微信立减金
|
||||
{{ item.product_name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="ml20 flex_start flex_items" style="">
|
||||
|
@ -190,7 +190,7 @@ function orderDetail(val) {
|
|||
.nodui {
|
||||
width: 100%;
|
||||
height: 192rpx;
|
||||
background-image: url('@/static/images/coupon/ydh.png') !important;
|
||||
background-image: url('@/static/images/coupon/kdh.png') !important;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -67,6 +67,11 @@ const getUrlPathName = () => {
|
|||
strR = strR.split('-')[1]
|
||||
}
|
||||
return strR
|
||||
} else if (url.indexOf('?') !== -1) {
|
||||
let strR = ''
|
||||
strR = url.split('=')[1]
|
||||
code = strR.split('-')[0]
|
||||
return strR.split('-')[1]
|
||||
} else {
|
||||
const str = url.split('/')
|
||||
const strP = str[str.length - 1]
|
||||
|
@ -151,7 +156,7 @@ window.parent.addEventListener('message', function (event) {
|
|||
nextTick(() => {
|
||||
Object.assign(srcList, {
|
||||
url: getTimesTamp(srcData.url),
|
||||
title: srcList.title,
|
||||
title: srcData.title,
|
||||
})
|
||||
uni.setNavigationBarTitle({
|
||||
title: srcList.title,
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
:lottery-size="lotteryConfig.lotterySize"
|
||||
:action-size="lotteryConfig.actionSize"
|
||||
:ring-count="6"
|
||||
:duration="4"
|
||||
:duration="2"
|
||||
:self-rotaty="false"
|
||||
:img-circled="true"
|
||||
:canvasCached="true"
|
||||
|
@ -208,13 +208,12 @@ export default {
|
|||
useStore.setUserInfo({ token })
|
||||
}
|
||||
// eslint-disable-next-line camelcase
|
||||
this.activity_code = activity_code || 'TT1234'
|
||||
this.activity_code = activity_code
|
||||
// const token = 'eb1272c9c7e5f5032e75aa76222f63ae91'
|
||||
// const useStore = useUserStore()
|
||||
// useStore.setUserInfo({ token })
|
||||
this.prizeList = []
|
||||
this.getConfig()
|
||||
this.getPrizeList()
|
||||
},
|
||||
created() {},
|
||||
mounted() {},
|
||||
|
@ -248,10 +247,10 @@ export default {
|
|||
uni.hideLoading()
|
||||
if (res.code === 200) {
|
||||
// eslint-disable-next-line camelcase
|
||||
const { activity_info, activity_title, lottery_code, lottery_count, use_lottery_count } =
|
||||
res.data
|
||||
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
|
||||
// eslint-disable-next-line camelcase
|
||||
this.lottery_code = lottery_code
|
||||
// eslint-disable-next-line camelcase
|
||||
|
@ -263,10 +262,11 @@ export default {
|
|||
icon: 'none',
|
||||
})
|
||||
}
|
||||
this.getPrizeList()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none',
|
||||
title: res.message,
|
||||
icon: 'error',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -293,7 +293,7 @@ export default {
|
|||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
title: res.message,
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
|
@ -329,10 +329,17 @@ export default {
|
|||
const params = {
|
||||
lottery_code: this.lottery_code,
|
||||
}
|
||||
if (this.isStatus) {
|
||||
if (this.status === 1 || this.status === 5) {
|
||||
uni.showToast({
|
||||
title: '权益已失效',
|
||||
icon: 'none',
|
||||
title: '活动未开始',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.status === 3 || this.status === 4) {
|
||||
uni.showToast({
|
||||
title: '活动已结束',
|
||||
icon: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
@ -345,8 +352,10 @@ export default {
|
|||
// eslint-disable-next-line camelcase
|
||||
const index = this.prizeList.findIndex((item) => item.prizeId === product_id)
|
||||
this.prizeIndex = index
|
||||
} else {
|
||||
} else if (res.message === '未中奖') {
|
||||
this.prizeIndex = this.prizeList.findIndex((ele) => ele.prizeId === 0)
|
||||
} else {
|
||||
this.prizeing = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none',
|
||||
|
|
|
@ -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.amount }}</text>
|
||||
<text class="f48 bolder one">{{ item.show_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt40 flex_between flex_items">
|
||||
|
|
Loading…
Reference in New Issue