This commit is contained in:
2023-10-10 14:10:32 +08:00
parent e36d60d015
commit 2f788956c6
8 changed files with 1597 additions and 1509 deletions

View File

@@ -36,9 +36,9 @@
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.22.15",
"@babel/runtime": "^7.23.1",
"@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.1.5",
"@nutui/nutui-taro": "^4.1.6",
"@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.16",
"@tarojs/helper": "3.6.16",
@@ -54,24 +54,24 @@
"@tarojs/runtime": "3.6.16",
"@tarojs/shared": "3.6.16",
"@tarojs/taro": "3.6.16",
"dayjs": "^1.11.9",
"dayjs": "^1.11.10",
"pinia": "^2.1.6",
"vue": "^3.3.4"
},
"devDependencies": {
"@babel/core": "^7.22.17",
"@babel/core": "^7.23.0",
"@tarojs/cli": "3.6.16",
"@tarojs/taro-loader": "3.6.16",
"@tarojs/webpack5-runner": "3.6.16",
"@types/node": "^18.17.15",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@types/node": "^18.18.4",
"@types/webpack-env": "^1.18.2",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-sfc": "^3.3.4",
"babel-preset-taro": "3.6.16",
"css-loader": "3.4.2",
"eslint": "^8.49.0",
"eslint": "^8.51.0",
"eslint-config-taro": "3.6.16",
"eslint-plugin-vue": "^9.17.0",
"style-loader": "1.3.0",
@@ -79,7 +79,7 @@
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.2.2",
"vue-loader": "^17.3.0",
"webpack": "^5.88.2"
}
}

2711
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,81 +1,81 @@
export default defineAppConfig({
pages: [
"pages/index/index",
"pages/category/index",
"pages/cart/index",
"pages/user/index",
'pages/index/index',
'pages/category/index',
'pages/cart/index',
'pages/user/index'
],
subPackages: [
{
root: "pages/users",
root: 'pages/users',
pages: [
"order_list/index",
"setting/index",
"user_setting/index",
"settled_mer/index",
"order_list_detail/index",
"account/index",
"distribution/index",
"distribution/integral/index",
"distribution/userlist/index",
"login/index",
"bindPhone/index",
],
'order_list/index',
'setting/index',
'user_setting/index',
'settled_mer/index',
'order_list_detail/index',
'account/index',
'distribution/index',
'distribution/integral/index',
'distribution/userlist/index',
'login/index',
'bindPhone/index'
]
},
{
root: "pages/goods",
root: 'pages/goods',
pages: [
"goods_detail/index",
"order_create/index",
"order_status/index",
],
'goods_detail/index',
'order_create/index',
'order_status/index'
]
},
{
root: "pages/admin",
root: 'pages/admin',
pages: [
"verify/index",
"order_manage/index",
"order_manage/list/index",
"order_manage/detail/index",
"verify/verify_list/index",
"statistics/index",
"withdrawal/index",
],
'verify/index',
'order_manage/index',
'order_manage/list/index',
'order_manage/detail/index',
'verify/verify_list/index',
'statistics/index',
'withdrawal/index'
]
},
{
root: "pages/product",
pages: ["list/index", "addGoods/index"],
root: 'pages/product',
pages: ['list/index', 'addGoods/index']
},
{
root: "pages/game",
pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
root: 'pages/game',
pages: ['gamehome/index', 'gamedetail/index', 'gameview/index']
},
{
root: "pages/hotGoods",
pages: ["index/index", "hot_list/index"],
root: 'pages/hotGoods',
pages: ['index/index', 'hot_list/index']
},
{
root: "pages/mer",
pages: ["mer_detail/index"],
},
root: 'pages/mer',
pages: ['mer_detail/index']
}
],
window: {
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
},
tabBar: {
color: "#666666",
selectedColor: "#ff0000",
backgroundColor: "#ffffff",
borderStyle: "white",
color: '#666666',
selectedColor: '#ff0000',
backgroundColor: '#ffffff',
borderStyle: 'white',
list: [
{
pagePath: "pages/index/index",
iconPath: "static/tabbar/1-001.png",
selectedIconPath: "static/tabbar/1-002.png",
text: "首页",
pagePath: 'pages/index/index',
iconPath: 'static/tabbar/1-001.png',
selectedIconPath: 'static/tabbar/1-002.png',
text: '首页'
},
// {
// pagePath: "pages/category/index",
@@ -90,20 +90,20 @@ export default defineAppConfig({
// text: "购物车",
// },
{
pagePath: "pages/user/index",
iconPath: "static/tabbar/4-001.png",
selectedIconPath: "static/tabbar/4-002.png",
text: "我的",
},
],
pagePath: 'pages/user/index',
iconPath: 'static/tabbar/4-001.png',
selectedIconPath: 'static/tabbar/4-002.png',
text: '我的'
}
]
},
permission: {
"scope.userLocation": {
desc: "你的位置信息将用于小程序位置接口的效果展示",
'scope.userLocation': {
desc: '你的位置信息将用于小程序位置接口的效果展示'
}
},
},
requiredBackgroundModes: ["audio", "location"],
requiredBackgroundModes: ['audio', 'location'],
// @ts-ignore
requiredPrivateInfos: ["getLocation"],
lazyCodeLoading: "requiredComponents",
requiredPrivateInfos: ['getLocation'],
lazyCodeLoading: 'requiredComponents'
});

View File

@@ -6,7 +6,7 @@
:headers="config.headers"
@success="success"
@failure="failure"
:multiple="false"
:multiple="multiple"
>
</nut-uploader>
</template>
@@ -24,22 +24,26 @@ const props = defineProps({
max: {
type: Number,
default: 1
},
multiple: {
type: Boolean,
default: false
}
})
});
const emits = defineEmits(['update:list'])
const fileList = computed({
get: () => props.list,
set: (val) => emits('update:list', val)
})
});
const config = ref({
url: `${BASE_URL}/upload`,
headers: {
token: Taro.getStorageSync('token')
}
})
},
});
const success = (res: any) => {
const data = JSON.parse(res.responseText.data)
@@ -47,15 +51,15 @@ const success = (res: any) => {
Taro.showToast({
title: '上传成功',
icon: 'success'
})
}
});
};
const failure = () => {
Taro.showToast({
title: '上传失败',
icon: 'error'
})
}
});
};
</script>
<style lang="scss"></style>

View File

@@ -125,11 +125,11 @@
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { Find, Locationg3 } from "@nutui/icons-vue-taro";
import { ref } from "vue";
import { calculateDistance } from "../../../utils";
import { getMerCategory, getGoodList } from "../../../api/goods";
import Taro from '@tarojs/taro'
import {Find, Locationg3} from '@nutui/icons-vue-taro'
import {ref} from 'vue'
import {calculateDistance} from '../../../utils'
import {getGoodList, getMerCategory} from '../../../api/goods'
const swiperList = ref([]);
@@ -160,7 +160,7 @@ Taro.useLoad(() => {
const clickPhone = () => {
Taro.makePhoneCall({
phoneNumber: mer_info.value.phone,
phoneNumber: mer_info.value.mobile
});
};

View File

@@ -1,9 +0,0 @@
const obj = {
a: 1,
b: 3,
c: 10,
};
Object.keys(obj).forEach((item, index) => {
console.log(obj[item]);
});

View File

@@ -12,6 +12,9 @@
<view class="dot"></view>
</view>
</view>
<view v-if="goodInfo.status === 1" class="timeBox">
订单剩余{{ timeStr }}过期,请尽快核销
</view>
<!-- 商家信息 -->
<view class="mer-info">
<view class="left">
@@ -27,11 +30,11 @@
</view>
<view class="right">
<view class="icon" @click="toPhone">
<Service />
<Service/>
<text>电话</text>
</view>
<view class="icon" @click="toAdder">
<Find />
<Find/>
<text>导航</text>
</view>
</view>
@@ -43,7 +46,7 @@
<nut-cell>
<template #default>
<view class="top">
<image :src="goodInfo.BindGoods?.cover" />
<image :src="goodInfo.BindGoods?.cover"/>
<view class="title"
>{{ goodInfo.BindGoods?.name }}
</view>
@@ -86,7 +89,9 @@
<template #default>
<view style="text-align: right; width: 100%">
<view
>实付款({{ type === "1" ? "元" : "积分" }}):
>{{
goodInfo.status === 0 ? '应付款' : '实付款'
}}({{ type === '1' ? '元' : '积分' }}):
<nut-price
:price="goodInfo.number"
size="normal"
@@ -148,96 +153,123 @@
</template>
<script setup lang="ts">
import {
useLoad,
getStorageSync,
makePhoneCall,
openLocation,
showToast,
} from "@tarojs/taro";
import { Service, Find } from "@nutui/icons-vue-taro";
import { ref } from "vue";
import dayjs from "dayjs";
import Taro from '@tarojs/taro'
import {Find, Service} from '@nutui/icons-vue-taro'
import {ref} from 'vue'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import Pay from '@/components/Pay.vue'
const goodInfo = ref<any>({});
dayjs.extend(duration)
const goodInfo = ref<any>({})
const statusList = ref([
{
id: 0,
text: "待付款",
text: '待付款'
},
{
id: 1,
text: "待使用",
text: '待使用'
},
{
id: 2,
text: "已使用",
text: '已使用'
},
{
id: 3,
text: "已失效",
},
]);
text: '已失效'
}
])
const isShowCode = ref(false);
const isShowPay = ref(false);
const jfInfo = ref<any>({});
const isShowCode = ref(false)
const isShowPay = ref(false)
const jfInfo = ref<any>({})
const type = ref("");
const type = ref('')
const url = ref("");
const url = ref('')
useLoad((options) => {
type.value = options.type;
goodInfo.value = getStorageSync("item");
});
Taro.useLoad((options) => {
type.value = options.type
goodInfo.value = Taro.getStorageSync('item')
if (goodInfo.value.status === 1) {
startTime()
}
})
const toPhone = () => {
makePhoneCall({
phoneNumber: goodInfo.value.BindStore.phone,
});
};
Taro.makePhoneCall({
phoneNumber: goodInfo.value.BindStore.mobile
})
}
const toAdder = () => {
openLocation({
Taro.openLocation({
latitude: Number(goodInfo.value.BindStore.lat),
longitude: Number(goodInfo.value.BindStore.lon),
scale: 18,
});
};
scale: 18
})
}
const openPay = () => {
isShowPay.value = true;
jfInfo.value = getStorageSync("item");
};
isShowPay.value = true
jfInfo.value = Taro.getStorageSync('item')
}
const errPay = () => {
isShowPay.value = false;
showToast({
title: "支付失败",
icon: "none",
});
jfInfo.value = {};
};
isShowPay.value = false
Taro.showToast({
title: '支付失败',
icon: 'none'
})
jfInfo.value = {}
}
const closePay = () => {
isShowPay.value = false;
showToast({
title: "支付取消",
icon: "none",
});
jfInfo.value = {};
};
isShowPay.value = false
Taro.showToast({
title: '支付取消',
icon: 'none'
})
jfInfo.value = {}
}
const openCode = () => {
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
isShowCode.value = true;
};
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`
isShowCode.value = true
}
const closed = () => {
isShowCode.value = false;
url.value = "";
};
isShowCode.value = false
url.value = ''
}
let timeId: any
const timeStr = ref('????')
const startTime = () => {
const nowTime = dayjs()
const endTime = dayjs(goodInfo.value.expires * 1000)
// 计算剩余时间的持续时间对象
const duration = dayjs.duration(endTime.diff(nowTime))
// 格式化剩余时间
timeStr.value = duration.format('D天H小时m分钟s秒')
if (goodInfo.value.expires - dayjs().unix() > 0) {
clearInterval(timeId)
timeId = setTimeout(() => {
startTime()
}, 1000)
}
}
Taro.useUnload(() => {
clearTimeout(timeId)
})
</script>
<style lang="scss">
@@ -248,6 +280,13 @@ page {
position: relative;
}
.timeBox {
text-align: center;
font-weight: bold;
font-size: 30px;
padding: 30px;
}
.step-bar {
width: 100%;
height: 100px;

View File

@@ -1,8 +1,8 @@
<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getVerifyCode, applyMer, getMerTypeList } from "@/api/user";
import Upload from "@/components/Upload.vue";
import Taro from '@tarojs/taro'
import {ref} from 'vue'
import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user'
import Upload from '@/components/Upload.vue'
const visible = ref(false);
@@ -91,7 +91,7 @@ const onOk = async () => {
icon: "none",
});
setTimeout(() => {
Taro.redirectTo({
Taro.switchTab({
url: "/pages/index/index",
});
}, 3000);
@@ -222,6 +222,25 @@ const submit = () => {
placeholder="请输入联系电话"
/>
</nut-form-item>
<nut-form-item
:rules="[
{
required: true,
message: '请输入正确的店铺号码',
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
},
]"
label="店铺号码"
prop="phone"
required
>
<input
v-model="formValue.mobile"
:maxlength="11"
placeholder="请输入店铺号码"
type="text"
/>
</nut-form-item>
<nut-form-item
required
label="验证码"
@@ -470,7 +489,7 @@ const submit = () => {
},
]"
>
<Upload v-model:list="formValue.img" :max="5" />
<Upload v-model:list="formValue.img" :max="5" multiple/>
</nut-form-item>
<view class="btn">