邮储奶茶新增古茗和书亦烧仙草两个品牌
This commit is contained in:
parent
0e381014dc
commit
39f8eeeff6
|
@ -1,9 +1,5 @@
|
||||||
NODE_ENV = 'development'
|
NODE_ENV = 'development'
|
||||||
# 兴业优酷
|
|
||||||
# VITE_BASE_URL = 'http://192.168.110.50:8083'
|
|
||||||
# 邮储奶茶活动
|
# 邮储奶茶活动
|
||||||
# VITE_BASE_URL = 'http://milk.api.test.86698.cn'
|
VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
||||||
# VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
|
||||||
# 邮储音视频
|
# 邮储音视频
|
||||||
VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn'
|
|
||||||
# VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn/ycav'
|
# VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn/ycav'
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
NODE_ENV = 'test'
|
NODE_ENV = 'test'
|
||||||
|
|
||||||
# 邮储奶茶活动(测试环境)
|
# 邮储奶茶活动(测试环境)
|
||||||
# VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
VITE_BASE_URL = 'http://milk.test.api.cdlsxd.cn'
|
||||||
# VITE_YCNC_MERCH_CODE = '100310100018908'
|
VITE_YCNC_MERCH_CODE = '100310100018908'
|
||||||
|
|
||||||
|
|
||||||
# 邮储音视频活动(测试环境)
|
# 邮储音视频活动(测试环境)
|
||||||
VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn'
|
# VITE_BASE_URL = 'https://gateway.dev.cdlsxd.cn'
|
||||||
VITE_YCNC_MERCH_CODE = '100310100018908'
|
# VITE_YCNC_MERCH_CODE = '100310100018908'
|
70
index.html
70
index.html
|
@ -27,43 +27,43 @@
|
||||||
eruda.init()
|
eruda.init()
|
||||||
</script> -->
|
</script> -->
|
||||||
<script>
|
<script>
|
||||||
var clickCount = 0
|
// var clickCount = 0
|
||||||
var timer = null
|
// var timer = null
|
||||||
var isShow = false
|
// var isShow = false
|
||||||
function insertScript() {
|
// function insertScript() {
|
||||||
isShow = true
|
// isShow = true
|
||||||
// 创建一个新的script元素
|
// // 创建一个新的script元素
|
||||||
var src = 'https://fastly.jsdelivr.net/npm/eruda'
|
// var src = 'https://fastly.jsdelivr.net/npm/eruda'
|
||||||
var script = document.createElement('script')
|
// var script = document.createElement('script')
|
||||||
script.type = 'text/javascript'
|
// script.type = 'text/javascript'
|
||||||
script.src = src
|
// script.src = src
|
||||||
// 插入到head中
|
// // 插入到head中
|
||||||
document.head.appendChild(script)
|
// document.head.appendChild(script)
|
||||||
script.onload = function () {
|
// script.onload = function () {
|
||||||
eruda.init()
|
// eruda.init()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
document.addEventListener('click', function () {
|
// document.addEventListener('click', function () {
|
||||||
if (isShow) return false
|
// if (isShow) return false
|
||||||
if (clickCount < 6) {
|
// if (clickCount < 6) {
|
||||||
clickCount++
|
// clickCount++
|
||||||
console.log(`Clicked ${clickCount} times`)
|
// console.log(`Clicked ${clickCount} times`)
|
||||||
|
|
||||||
// 如果是第一次点击,则开始计时
|
// // 如果是第一次点击,则开始计时
|
||||||
if (clickCount === 1) {
|
// if (clickCount === 1) {
|
||||||
timer = setTimeout(() => {
|
// timer = setTimeout(() => {
|
||||||
clickCount = 0 // 重置点击计数
|
// clickCount = 0 // 重置点击计数
|
||||||
}, 2000)
|
// }, 2000)
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 如果点击次数达到6次,则清除计时器并重置状态
|
// // 如果点击次数达到6次,则清除计时器并重置状态
|
||||||
if (clickCount >= 6) {
|
// if (clickCount >= 6) {
|
||||||
clearTimeout(timer)
|
// clearTimeout(timer)
|
||||||
insertScript()
|
// insertScript()
|
||||||
clickCount = 0 // 重置点击计数
|
// clickCount = 0 // 重置点击计数
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -3,6 +3,8 @@ import BW from '/static/ycnc/bg-bwcj.png'
|
||||||
import NX from '/static/ycnc/bg-nxdc.png'
|
import NX from '/static/ycnc/bg-nxdc.png'
|
||||||
import CoCo from '/static/ycnc/bg-coco.png'
|
import CoCo from '/static/ycnc/bg-coco.png'
|
||||||
import CBD from '/static/ycnc/bg-cbd.png'
|
import CBD from '/static/ycnc/bg-cbd.png'
|
||||||
|
import GM from '/static/ycnc/bg-gm.png'
|
||||||
|
import SYSXC from '/static/ycnc/bg-sysxc.png'
|
||||||
// import CYYS from '/static/ycnc/bg-cyys.png'
|
// import CYYS from '/static/ycnc/bg-cyys.png'
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
|
@ -10,26 +12,43 @@ const config = {
|
||||||
name:'蜜雪冰城',
|
name:'蜜雪冰城',
|
||||||
src:MX,
|
src:MX,
|
||||||
height:974,
|
height:974,
|
||||||
|
order:1
|
||||||
},
|
},
|
||||||
"BW":{
|
"BW":{
|
||||||
name:'霸王茶姬',
|
name:'霸王茶姬',
|
||||||
src:BW,
|
src:BW,
|
||||||
height:974,
|
height:974,
|
||||||
|
order:2
|
||||||
},
|
},
|
||||||
"NX":{
|
"NX":{
|
||||||
name:'奈雪的茶',
|
name:'奈雪的茶',
|
||||||
src:NX,
|
src:NX,
|
||||||
height:584,
|
height:584,
|
||||||
|
order:5
|
||||||
},
|
},
|
||||||
"CoCo":{
|
"CoCo":{
|
||||||
name:'CoCo',
|
name:'CoCo',
|
||||||
src:CoCo,
|
src:CoCo,
|
||||||
height:584,
|
height:584,
|
||||||
|
order:6
|
||||||
},
|
},
|
||||||
"CBD":{
|
"CBD":{
|
||||||
name:'茶百道',
|
name:'茶百道',
|
||||||
src:CBD,
|
src:CBD,
|
||||||
height:584,
|
height:584,
|
||||||
|
order:7
|
||||||
|
},
|
||||||
|
"YCGM":{
|
||||||
|
name:'古茗',
|
||||||
|
src:GM,
|
||||||
|
height:584,
|
||||||
|
order:3,
|
||||||
|
},
|
||||||
|
"YCSY":{
|
||||||
|
name:'书亦烧仙草',
|
||||||
|
src:SYSXC,
|
||||||
|
height:584,
|
||||||
|
order:4
|
||||||
},
|
},
|
||||||
// "CYYS":{
|
// "CYYS":{
|
||||||
// name:'茶颜悦色',
|
// name:'茶颜悦色',
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<view class="w-full h-full flex flex-col">
|
<view class="w-full h-full flex flex-col">
|
||||||
<scroll-view scroll-y class="w-full h-full overflow-y-auto flex-1">
|
<scroll-view scroll-y class="w-full h-full overflow-y-auto flex-1">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image class="banner" :src="detailObj.main_image"></image>
|
<image class="banner" :src="detailObj.main_image" @click="testEvent"></image>
|
||||||
<view class="detail flex flex-col flex-justify-between">
|
<view class="detail flex flex-col flex-justify-between">
|
||||||
<view class="proname">{{ detailObj.name }}</view>
|
<view class="proname">{{ detailObj.name }}</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
|
@ -89,6 +89,29 @@
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var clickCount = 0
|
||||||
|
var timer = null
|
||||||
|
const testEvent = () => {
|
||||||
|
if (clickCount < 6) {
|
||||||
|
clickCount++
|
||||||
|
console.log(`Clicked ${clickCount} times`)
|
||||||
|
|
||||||
|
// 如果是第一次点击,则开始计时
|
||||||
|
if (clickCount === 1) {
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
clickCount = 0 // 重置点击计数
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果点击次数达到6次,则清除计时器并重置状态
|
||||||
|
if (clickCount >= 6) {
|
||||||
|
clearTimeout(timer)
|
||||||
|
clickCount = 0 // 重置点击计数
|
||||||
|
window.location.href = 'https://22233.cn/AAALM4HwLrAfdSCx'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
|
|
@ -98,7 +98,12 @@
|
||||||
getProductList({params}).then(res => {
|
getProductList({params}).then(res => {
|
||||||
const {milkList,
|
const {milkList,
|
||||||
milkVoucherList} = res
|
milkVoucherList} = res
|
||||||
productList.value = handleData(milkList,milkVoucherList);
|
const sortMilkList = milkList.sort((a,b)=>{
|
||||||
|
const orderA = config[a.brandFlag] ? config[a.brandFlag].order : Infinity;
|
||||||
|
const orderB = config[b.brandFlag] ? config[b.brandFlag].order : Infinity;
|
||||||
|
return orderA - orderB
|
||||||
|
})
|
||||||
|
productList.value = handleData(sortMilkList,milkVoucherList);
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
console.log(err);
|
console.log(err);
|
||||||
})
|
})
|
||||||
|
|
|
@ -113,12 +113,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, unref, onMounted, nextTick } from "vue";
|
import { ref, reactive, unref, onMounted } from "vue";
|
||||||
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
// import ticketRecieve from './components/ticket-recieve.vue';
|
// import ticketRecieve from './components/ticket-recieve.vue';
|
||||||
import member from "./components/member.vue";
|
import member from "./components/member.vue";
|
||||||
import rechargeItem from "./components/recharge-item.vue";
|
import rechargeItem from "./components/recharge-item.vue";
|
||||||
import { getBrandList, getProductList, login } from "@/api/ycysp";
|
import { getBrandList, getProductList, login } from "@/api/ycysp";
|
||||||
// import { generateUUID } from "@/utils/utils";
|
import { generateUUID,getQueryString } from "@/utils/utils";
|
||||||
import { createOrder } from "@/api/ycysp";
|
import { createOrder } from "@/api/ycysp";
|
||||||
import useCode from "./hooks/useCode";
|
import useCode from "./hooks/useCode";
|
||||||
// const reg =
|
// const reg =
|
||||||
|
@ -135,9 +136,10 @@ const getBrand = () => {
|
||||||
return getBrandList()
|
return getBrandList()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const { list } = res;
|
const { list } = res;
|
||||||
|
const is_anchor_brand_id = getQueryString('brand_id')
|
||||||
brandArr.value = list.map((item, index) => ({
|
brandArr.value = list.map((item, index) => ({
|
||||||
...item,
|
...item,
|
||||||
isChecked: index === 0,
|
isChecked: is_anchor_brand_id ? item.id === Number(is_anchor_brand_id) : index === 0,
|
||||||
}));
|
}));
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
scrollLeft.value = 60
|
scrollLeft.value = 60
|
||||||
|
@ -156,9 +158,10 @@ const getProduct = () => {
|
||||||
getProductList({ params })
|
getProductList({ params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const { list } = res;
|
const { list } = res;
|
||||||
|
const is_anchor_product_id = getQueryString('product_id')
|
||||||
productArr.value = list.map((item, index) => ({
|
productArr.value = list.map((item, index) => ({
|
||||||
...item,
|
...item,
|
||||||
isSelected: index === 0,
|
isSelected: is_anchor_product_id ? item.id === Number(is_anchor_product_id) : index === 0,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -239,6 +242,11 @@ const toOrder = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
const {brand_id,product_id} = options;
|
||||||
|
console.log(options)
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getBrand();
|
await getBrand();
|
||||||
getProduct();
|
getProduct();
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Loading…
Reference in New Issue