This commit is contained in:
@@ -8,8 +8,8 @@ TARO_APP_KEY='1234567890'
|
||||
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
||||
|
||||
# 骰子游戏链接
|
||||
# TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
||||
TARO_APP_GAME='http://192.168.31.225:10086?uid='
|
||||
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
||||
# TARO_APP_GAME='http://192.168.31.225:10086?uid='
|
||||
|
||||
# 捕鱼游戏链接
|
||||
TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?uid='
|
||||
@@ -9,7 +9,7 @@ const {robot = 1, desc} = argv;
|
||||
|
||||
const CIPluginOptFn = async () => {
|
||||
/**
|
||||
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
|
||||
* @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions
|
||||
* @type {CIOptions}
|
||||
*/
|
||||
return {
|
||||
@@ -133,7 +133,7 @@ const config = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = function (merge) {
|
||||
module.exports = function(merge) {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return merge({}, config, require('./dev'));
|
||||
}
|
||||
|
||||
242
package.json
242
package.json
@@ -1,123 +1,123 @@
|
||||
{
|
||||
"name": "jdt-user",
|
||||
"version": "4.0.2",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"templateInfo": {
|
||||
"name": "jdt-user",
|
||||
"typescript": true,
|
||||
"css": "sass"
|
||||
},
|
||||
"taroConfig": {
|
||||
"version": "4.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:test": "taro build --type weapp --mode test",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"build:h5": "taro build --type h5",
|
||||
"build:rn": "taro build --type rn",
|
||||
"build:qq": "taro build --type qq",
|
||||
"build:jd": "taro build --type jd",
|
||||
"build:quickapp": "taro build --type quickapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
"dev:tt": "npm run build:tt -- --watch",
|
||||
"dev:h5": "npm run build:h5 -- --watch",
|
||||
"dev:rn": "npm run build:rn -- --watch",
|
||||
"dev:qq": "npm run build:qq -- --watch",
|
||||
"dev:jd": "npm run build:jd -- --watch",
|
||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||
"lint": "eslint --ext .ts,.vue .",
|
||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
"preview": "vite preview",
|
||||
"cz": "cz",
|
||||
"lf": "npx prettier --write --end-of-line lf .",
|
||||
"postinstall": "weapp-tw patch",
|
||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 3 versions",
|
||||
"Android >= 4.1",
|
||||
"ios >= 8"
|
||||
],
|
||||
"author": "",
|
||||
"lint-staged": {
|
||||
"*.{ts,vue}": [
|
||||
"eslint --ext .ts,.vue .",
|
||||
"npx prettier --write --end-of-line lf ."
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-customizable"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.23.5",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.3.9",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "3.6.32",
|
||||
"@tarojs/helper": "3.6.32",
|
||||
"@tarojs/plugin-framework-vue3": "3.6.32",
|
||||
"@tarojs/plugin-html": "3.6.32",
|
||||
"@tarojs/plugin-platform-alipay": "3.6.32",
|
||||
"@tarojs/plugin-platform-h5": "3.6.32",
|
||||
"@tarojs/plugin-platform-jd": "3.6.32",
|
||||
"@tarojs/plugin-platform-qq": "3.6.32",
|
||||
"@tarojs/plugin-platform-swan": "3.6.32",
|
||||
"@tarojs/plugin-platform-tt": "3.6.32",
|
||||
"@tarojs/plugin-platform-weapp": "3.6.32",
|
||||
"@tarojs/runtime": "3.6.32",
|
||||
"@tarojs/shared": "3.6.32",
|
||||
"@tarojs/taro": "3.6.32",
|
||||
"dayjs": "^1.11.10",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
"@commitlint/cli": "^18.4.3",
|
||||
"@commitlint/config-conventional": "^18.4.3",
|
||||
"@tarojs/cli": "3.6.32",
|
||||
"@tarojs/plugin-mini-ci": "3.6.31",
|
||||
"@tarojs/taro-loader": "3.6.32",
|
||||
"@tarojs/webpack5-runner": "3.6.32",
|
||||
"@types/node": "^18.19.1",
|
||||
"@types/webpack-env": "^1.18.4",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"@unocss/webpack": "^0.60.0",
|
||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
||||
"@vue/compiler-sfc": "^3.3.9",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"babel-preset-taro": "3.6.32",
|
||||
"commitizen": "^4.3.0",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.0.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-taro": "3.6.32",
|
||||
"eslint-plugin-vue": "^9.19.2",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.1.0",
|
||||
"postcss": "8.4.29",
|
||||
"postcss-rem-to-responsive-pixel": "^6.0.1",
|
||||
"style-loader": "1.3.0",
|
||||
"stylelint": "9.3.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5",
|
||||
"unplugin-vue-components": "^0.23.0",
|
||||
"vue-loader": "^17.3.1",
|
||||
"weapp-tailwindcss": "^3.2.0",
|
||||
"webpack": "^5.89.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
|
||||
"name": "jdt-user",
|
||||
"version": "4.0.3",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"templateInfo": {
|
||||
"name": "jdt-user",
|
||||
"typescript": true,
|
||||
"css": "sass"
|
||||
},
|
||||
"taroConfig": {
|
||||
"version": "4.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:test": "taro build --type weapp --mode test",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"build:h5": "taro build --type h5",
|
||||
"build:rn": "taro build --type rn",
|
||||
"build:qq": "taro build --type qq",
|
||||
"build:jd": "taro build --type jd",
|
||||
"build:quickapp": "taro build --type quickapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
"dev:tt": "npm run build:tt -- --watch",
|
||||
"dev:h5": "npm run build:h5 -- --watch",
|
||||
"dev:rn": "npm run build:rn -- --watch",
|
||||
"dev:qq": "npm run build:qq -- --watch",
|
||||
"dev:jd": "npm run build:jd -- --watch",
|
||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||
"lint": "eslint --ext .ts,.vue .",
|
||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
"preview": "vite preview",
|
||||
"cz": "cz",
|
||||
"lf": "npx prettier --write --end-of-line lf .",
|
||||
"postinstall": "weapp-tw patch",
|
||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 3 versions",
|
||||
"Android >= 4.1",
|
||||
"ios >= 8"
|
||||
],
|
||||
"author": "",
|
||||
"lint-staged": {
|
||||
"*.{ts,vue}": [
|
||||
"eslint --ext .ts,.vue .",
|
||||
"npx prettier --write --end-of-line lf ."
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-customizable"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.23.5",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.3.9",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "3.6.34",
|
||||
"@tarojs/helper": "3.6.34",
|
||||
"@tarojs/plugin-framework-vue3": "3.6.34",
|
||||
"@tarojs/plugin-html": "3.6.34",
|
||||
"@tarojs/plugin-platform-alipay": "3.6.34",
|
||||
"@tarojs/plugin-platform-h5": "3.6.34",
|
||||
"@tarojs/plugin-platform-jd": "3.6.34",
|
||||
"@tarojs/plugin-platform-qq": "3.6.34",
|
||||
"@tarojs/plugin-platform-swan": "3.6.34",
|
||||
"@tarojs/plugin-platform-tt": "3.6.34",
|
||||
"@tarojs/plugin-platform-weapp": "3.6.34",
|
||||
"@tarojs/runtime": "3.6.34",
|
||||
"@tarojs/shared": "3.6.34",
|
||||
"@tarojs/taro": "3.6.34",
|
||||
"dayjs": "^1.11.10",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
"@commitlint/cli": "^18.4.3",
|
||||
"@commitlint/config-conventional": "^18.4.3",
|
||||
"@tarojs/cli": "3.6.34",
|
||||
"@tarojs/plugin-mini-ci": "3.6.34",
|
||||
"@tarojs/taro-loader": "3.6.34",
|
||||
"@tarojs/webpack5-runner": "3.6.34",
|
||||
"@types/node": "^18.19.1",
|
||||
"@types/webpack-env": "^1.18.4",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"@unocss/webpack": "^0.60.0",
|
||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
||||
"@vue/compiler-sfc": "^3.3.9",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"babel-preset-taro": "3.6.34",
|
||||
"commitizen": "^4.3.0",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.0.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-taro": "3.6.34",
|
||||
"eslint-plugin-vue": "^9.19.2",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.1.0",
|
||||
"postcss": "8.4.29",
|
||||
"postcss-rem-to-responsive-pixel": "^6.0.1",
|
||||
"style-loader": "1.3.0",
|
||||
"stylelint": "9.3.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5",
|
||||
"unplugin-vue-components": "^0.23.0",
|
||||
"vue-loader": "^17.3.1",
|
||||
"weapp-tailwindcss": "^3.2.0",
|
||||
"webpack": "^5.89.0"
|
||||
},
|
||||
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
|
||||
}
|
||||
|
||||
9
src/api/code.ts
Normal file
9
src/api/code.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from "../utils/request";
|
||||
|
||||
// 获取二维码信息
|
||||
export const getQrCode = (data: object) =>
|
||||
request("/qrcode/get", data, "POST");
|
||||
|
||||
// 绑定二维码
|
||||
export const bindQrCode = (data: object) =>
|
||||
request("/qrcode/bind", data, "POST");
|
||||
@@ -86,3 +86,10 @@ export const getActiveOrderDetail = (data: object) =>
|
||||
// 校验交易密码
|
||||
export const checkTradePwd = (data: object) =>
|
||||
request('/user/check/payPassword', data, 'POST');
|
||||
|
||||
// 获取活动商品或者活动积分商品
|
||||
export const getHdOrJfGoods = (data: object) =>
|
||||
request('/activity/goods', data, 'POST');
|
||||
|
||||
// 获取支付列表
|
||||
export const getPayList = (data: object) => request('/payType', data, 'POST');
|
||||
|
||||
@@ -73,7 +73,7 @@ export default defineAppConfig({
|
||||
},
|
||||
{
|
||||
root: 'pages/marketing',
|
||||
pages: ['sign/index'],
|
||||
pages: ['sign/index', 'yq/index', 'scratch/index'],
|
||||
},
|
||||
{
|
||||
root: 'pages/search',
|
||||
|
||||
@@ -51,7 +51,10 @@
|
||||
<nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell>
|
||||
<nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell>
|
||||
<nut-cell title="下单时间:" :desc="info.add_time"></nut-cell>
|
||||
<nut-cell title="核销时间:" :desc="info.User?.phone"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="info.status === 2"
|
||||
title="核销时间:"
|
||||
:desc="info.cancel_time"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="info.status === 2"
|
||||
title="核销人员:"
|
||||
|
||||
@@ -149,6 +149,7 @@ const getData = async () => {
|
||||
|
||||
const tabChange = (e: number) => {
|
||||
tabVal.value = e;
|
||||
dataList.value = [];
|
||||
getData();
|
||||
};
|
||||
|
||||
@@ -160,7 +161,7 @@ const toDetailPage = (item: any) => {
|
||||
};
|
||||
|
||||
Taro.useReachBottom(() => {
|
||||
if (pageOpt.value.total === dataList.value.length)
|
||||
if (pageOpt.value.total >= dataList.value.length)
|
||||
return Taro.showToast({
|
||||
title: '没有更多数据了',
|
||||
icon: 'none',
|
||||
|
||||
@@ -1,15 +1,57 @@
|
||||
<template>
|
||||
<view class="flex flex-col items-center pt-[208px]">
|
||||
<back />
|
||||
<image class="h-[152px]" :src="par.header" />
|
||||
<view class="list mt-[30px]">
|
||||
<view class="bg-white w-[700px] h-[300px] rounded-[20px]"></view>
|
||||
<view class="list mt-[30px]" v-if="data.length > 0">
|
||||
<view
|
||||
class="bg-white p-[20px] w-[700px] rounded-[20px] mb-[20px] flex"
|
||||
v-for="(item, index) in data"
|
||||
:key="index">
|
||||
<image
|
||||
class="w-[200px] h-[200px] rounded-[10px] mr-[10px]"
|
||||
:src="item.cover"></image>
|
||||
<view class="flex-1 flex flex-col justify-between">
|
||||
<nut-ellipsis
|
||||
style="font-size: 20px"
|
||||
direction="end"
|
||||
:rows="2"
|
||||
:content="item.name"></nut-ellipsis>
|
||||
<view>
|
||||
<view class="text-[#9E9E9E] text-[26px]"
|
||||
>剩余: {{ item.stock }}</view
|
||||
>
|
||||
<view class="flex justify-between items-end">
|
||||
<view>
|
||||
<view class="text-[#F83D3D] text-[30px] font-bold"
|
||||
>{{ item.number }}元</view
|
||||
>
|
||||
<view class="text-[#F83D3D] text-[30px] font-bold"
|
||||
>{{ item.exchange }}积分</view
|
||||
>
|
||||
</view>
|
||||
<nut-button type="primary" size="mini" @click="toPay(item)"
|
||||
>购买</nut-button
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty
|
||||
class="mt-[130px]"
|
||||
v-else
|
||||
image="empty"
|
||||
description="暂时没有商品"></nut-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getHdOrJfGoods, createActiveOrder} from '@/api/goods';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import {addCart} from '@/api/cart';
|
||||
import Back from '@/components/Back.vue';
|
||||
|
||||
const par = ref<any>({});
|
||||
|
||||
@@ -32,7 +74,66 @@ Taro.useLoad(e => {
|
||||
...par.value,
|
||||
type: e.type,
|
||||
};
|
||||
getList();
|
||||
});
|
||||
|
||||
const data = ref<any[]>([]);
|
||||
|
||||
const page = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
itemCount: 0,
|
||||
});
|
||||
|
||||
const getList = async () => {
|
||||
Taro.showLoading({
|
||||
title: '加载中',
|
||||
});
|
||||
const res = await getHdOrJfGoods({
|
||||
PageNum: page.value.page,
|
||||
PageSize: page.value.pageSize,
|
||||
type: Number(par.value.type),
|
||||
});
|
||||
data.value.push(...res.data.data);
|
||||
page.value.itemCount = res.data.total;
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
Taro.useReachBottom(() => {
|
||||
if (page.value.page < Math.ceil(page.value.itemCount / page.value.pageSize)) {
|
||||
page.value.page++;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
|
||||
const toPay = async item => {
|
||||
const tk = Taro.getStorageSync('token');
|
||||
if (!tk) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/login/index',
|
||||
});
|
||||
return;
|
||||
}
|
||||
await addCart({
|
||||
Bid: item.Store.bid,
|
||||
Gid: item.gid,
|
||||
Number: 1,
|
||||
});
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = await getUserPoint({
|
||||
phone: user_info.data.phone,
|
||||
bid: item.Store.bid,
|
||||
});
|
||||
|
||||
const res = await createActiveOrder({
|
||||
Bid: [item.Store.bid],
|
||||
custID: data.data.store_user_id,
|
||||
});
|
||||
|
||||
Taro.navigateTo({
|
||||
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${item.Store.bid}&OrderType=1`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -12,6 +12,7 @@ const url = ref('');
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
const token = Taro.getStorageSync('token');
|
||||
// url.value = 'http://huakk.jdt168.com/#/pages/index/index';
|
||||
if (token) {
|
||||
url.value = `${process.env.TARO_APP_GAME}${Taro.getStorageSync('token')}`;
|
||||
} else {
|
||||
|
||||
@@ -8,21 +8,25 @@
|
||||
<view class="line"></view>
|
||||
<nut-price position="after" symbol="积分" :price="b" size="large" />
|
||||
</view>
|
||||
<!-- {{ payVal }} -->
|
||||
<nut-radio-group class="w-[95%]" v-model="payVal">
|
||||
<nut-cell-group class="w-full">
|
||||
<nut-cell class="text-[#333333]" title="支付方式"></nut-cell>
|
||||
<nut-cell
|
||||
v-for="(item, index) in payList"
|
||||
:key="index"
|
||||
class="flex items-center"
|
||||
title="微信支付"
|
||||
@click="cellClick(1, false)">
|
||||
:title="item.name"
|
||||
:desc="item.number > 0 ? `可用积分:${item.number}` : ''"
|
||||
@click="cellClick(item.ID)">
|
||||
<template #icon>
|
||||
<IconFont size="30" :name="require('../../../static/wx.png')" />
|
||||
<IconFont size="30" :name="item.icon" />
|
||||
</template>
|
||||
<template #link>
|
||||
<nut-radio :label="1"></nut-radio>
|
||||
<nut-radio :label="item.ID"></nut-radio>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<nut-cell
|
||||
<!-- <nut-cell
|
||||
class="flex items-center"
|
||||
title="平台积分支付"
|
||||
:desc="`剩余积分:${orderData.User?.integral || 0}`"
|
||||
@@ -49,7 +53,7 @@
|
||||
:disabled="orderData.integral === 0"
|
||||
:label="3"></nut-radio>
|
||||
</template>
|
||||
</nut-cell>
|
||||
</nut-cell> -->
|
||||
</nut-cell-group>
|
||||
</nut-radio-group>
|
||||
<view class="w-[90%] mt-[100px]">
|
||||
@@ -99,7 +103,7 @@
|
||||
import Taro from '@tarojs/taro';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {onUnmounted, ref} from 'vue';
|
||||
import {getActiveOrderDetail, checkTradePwd} from '@/api/goods';
|
||||
import {getActiveOrderDetail, checkTradePwd, getPayList} from '@/api/goods';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import {payOrder} from '@/api/order';
|
||||
import {isCheckTradePwd} from '@/api/user';
|
||||
@@ -130,12 +134,21 @@ const opt = ref<any>({});
|
||||
Taro.useLoad(e => {
|
||||
const {oid, bid, OrderType} = e;
|
||||
opt.value = e;
|
||||
get_pay_list();
|
||||
getData(oid, bid, OrderType);
|
||||
});
|
||||
|
||||
const a = ref(0);
|
||||
const b = ref(0);
|
||||
|
||||
const payList = ref<any>([]);
|
||||
|
||||
const get_pay_list = async () => {
|
||||
const res = await getPayList({});
|
||||
// console.log(res);
|
||||
payList.value = res.data.data || [];
|
||||
};
|
||||
|
||||
const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = await getUserPoint({
|
||||
@@ -163,7 +176,7 @@ const getData = async (oid: string, bid: string, OrderType: number) => {
|
||||
b.value += item.exchange;
|
||||
});
|
||||
|
||||
console.log(orderData.value);
|
||||
// console.log(orderData.value);
|
||||
if (!orderData.value.oid)
|
||||
return Taro.showToast({
|
||||
title: '未获取到订单信息~',
|
||||
@@ -290,16 +303,8 @@ const shortClose = (isMsg: boolean = true) => {
|
||||
if (isMsg) Taro.showToast({title: '支付取消', icon: 'none'});
|
||||
};
|
||||
|
||||
const cellClick = (val: number, isTrue: boolean) => {
|
||||
if (isTrue) {
|
||||
Taro.showToast({
|
||||
title: '该支付暂不可用!',
|
||||
icon: 'none',
|
||||
});
|
||||
payVal.value = undefined;
|
||||
} else {
|
||||
payVal.value = val;
|
||||
}
|
||||
const cellClick = (val: number) => {
|
||||
payVal.value = val;
|
||||
};
|
||||
|
||||
const countdownTime = () => {
|
||||
|
||||
@@ -69,7 +69,8 @@ page {
|
||||
}
|
||||
|
||||
.btn-2 {
|
||||
background-image: url('//p1.meituan.net/csc/8cc2b518031eb7424b184d90a583d805146287.png');
|
||||
// background-image: url('//p1.meituan.net/csc/8cc2b518031eb7424b184d90a583d805146287.png');
|
||||
background-image: url('../../static/game_banner.png');
|
||||
background-size: 100% 100%;
|
||||
width: 300px;
|
||||
height: 220px;
|
||||
@@ -114,7 +115,8 @@ page {
|
||||
}
|
||||
|
||||
.ad {
|
||||
background-image: url('https://jdt168.oss-cn-guangzhou.aliyuncs.com/ad.png');
|
||||
// background-image: url('https://jdt168.oss-cn-guangzhou.aliyuncs.com/ad.png');
|
||||
background-image: url('https://pic.imgdb.cn/item/6697aa0dd9c307b7e95c94d9.png');
|
||||
background-size: 100% 100%;
|
||||
height: 180px;
|
||||
margin: 20px;
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
<view class="text">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ad" @click="showTips('该功能暂未开放')"></view>
|
||||
<navigator class="ad" url="/pages/marketing/yq/index" open-type="navigate" hover-class="none">
|
||||
</navigator>
|
||||
<MerList :get-user-location="getUserLocal" />
|
||||
</view>
|
||||
</template>
|
||||
@@ -87,6 +88,22 @@ const clickSearch = () => {
|
||||
};
|
||||
|
||||
Taro.useLoad(async () => {
|
||||
Taro.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
Taro.requirePrivacyAuthorize({
|
||||
success: res => {
|
||||
console.log('用户同意授权');
|
||||
console.log(res);
|
||||
},
|
||||
fail: () => {
|
||||
console.log('用户拒绝授权');
|
||||
Taro.exitMiniProgram();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
getNavLists();
|
||||
getUserLocal();
|
||||
});
|
||||
|
||||
3
src/pages/marketing/scratch/index.config.ts
Normal file
3
src/pages/marketing/scratch/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "刮奖",
|
||||
});
|
||||
67
src/pages/marketing/scratch/index.scss
Normal file
67
src/pages/marketing/scratch/index.scss
Normal file
@@ -0,0 +1,67 @@
|
||||
page {
|
||||
background-color: #ffab00;
|
||||
}
|
||||
|
||||
.bg {
|
||||
position: relative;
|
||||
background-image: url('https://pic.imgdb.cn/item/6697c1bbd9c307b7e97c2665.png');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
height: 1800px;
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
top: 378px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
.tc {
|
||||
height: 365px;
|
||||
width: 575px;
|
||||
}
|
||||
|
||||
.textBg {
|
||||
background-image: url('https://pic.imgdb.cn/item/6697d455d9c307b7e9932fbc.png');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
font-weight: bolder;
|
||||
font-size: 60px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-image: url('https://pic.imgdb.cn/item/6697c87fd9c307b7e984a370.png');
|
||||
background-size: 100% 100%;
|
||||
width: 600px;
|
||||
height: 130px;
|
||||
position: absolute;
|
||||
top: 760px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
.img {
|
||||
background-image: url('https://pic.imgdb.cn/item/6697c956d9c307b7e985b5b9.png');
|
||||
background-size: 100% 100%;
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
position: absolute;
|
||||
top: 950px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
.img1 {
|
||||
background-image: url('https://pic.imgdb.cn/item/6697c956d9c307b7e985b5c0.png');
|
||||
background-size: 100% 100%;
|
||||
width: 700px;
|
||||
height: 500px;
|
||||
position: absolute;
|
||||
top: 1500px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
141
src/pages/marketing/scratch/index.vue
Normal file
141
src/pages/marketing/scratch/index.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<view class="bg">
|
||||
<view class="box">
|
||||
<image
|
||||
v-if="status === 0"
|
||||
class="tc"
|
||||
@click="kk"
|
||||
src="https://pic.imgdb.cn/item/6697c82bd9c307b7e9843788.png" />
|
||||
<view
|
||||
class="tc text-[#F33D00] text-center textBg"
|
||||
v-else-if="status === 1">
|
||||
<view>恭喜获得游戏豆奖励</view>
|
||||
<view>{{ codeInfo.pulse }}</view>
|
||||
</view>
|
||||
<image
|
||||
class="tc"
|
||||
v-else
|
||||
src="https://pic.imgdb.cn/item/6697d32ed9c307b7e991c2c5.png"></image>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<nut-button
|
||||
v-if="!isLogin"
|
||||
style="width: 100%; height: 100%; opacity: 0"
|
||||
type="primary"
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
>手机号一键登录</nut-button
|
||||
>
|
||||
<nut-button
|
||||
v-else
|
||||
style="width: 100%; height: 100%; opacity: 0"
|
||||
type="primary"
|
||||
@click="ok"
|
||||
>领取</nut-button
|
||||
>
|
||||
</view>
|
||||
<view class="img"></view>
|
||||
<view class="img1"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getPhone, login} from '@/api/user';
|
||||
import {getQrCode, bindQrCode} from '@/api/code';
|
||||
import './index.scss';
|
||||
|
||||
const status = ref(0);
|
||||
|
||||
const optData = ref<any>({});
|
||||
|
||||
const isLogin = ref(false);
|
||||
|
||||
const codeInfo = ref<any>({});
|
||||
|
||||
Taro.useLoad(opt => {
|
||||
optData.value = opt;
|
||||
const tk = Taro.getStorageSync('token');
|
||||
if (tk) {
|
||||
isLogin.value = true;
|
||||
}
|
||||
getInfo();
|
||||
});
|
||||
|
||||
const getInfo = async () => {
|
||||
const res = await getQrCode({
|
||||
code: optData.value.qid,
|
||||
});
|
||||
codeInfo.value = res.data.data;
|
||||
};
|
||||
|
||||
const kk = () => {
|
||||
if (codeInfo.value.pulse > 0) {
|
||||
status.value = 1;
|
||||
} else {
|
||||
status.value = 2;
|
||||
}
|
||||
};
|
||||
|
||||
const ok = async () => {
|
||||
const res = await bindQrCode({
|
||||
qid: optData.value.qid,
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
Taro.switchTab({
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
}, 2000);
|
||||
};
|
||||
|
||||
const userInfo = ref({
|
||||
phone: '',
|
||||
});
|
||||
|
||||
const getPhoneNumber = async (e: any) => {
|
||||
Taro.showLoading({
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const {code} = e.detail;
|
||||
const res = await getPhone({
|
||||
code: code,
|
||||
});
|
||||
userInfo.value.phone = res.data.phone;
|
||||
if (!res.data.phone)
|
||||
return Taro.showToast({
|
||||
title: '手机号获取失败',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.login({
|
||||
success: async res => {
|
||||
Taro.setStorageSync('wx_code', res.code);
|
||||
const ress = await login({
|
||||
Code: Taro.getStorageSync('wx_code'),
|
||||
Phone: userInfo.value.phone,
|
||||
Referee: Taro.getStorageSync('bind_id'),
|
||||
});
|
||||
Taro.showToast({
|
||||
title: `${ress.msg},请再次领取`,
|
||||
icon: 'success',
|
||||
});
|
||||
Taro.setStorageSync('token', ress.data.token);
|
||||
Taro.removeStorageSync('wx_code');
|
||||
Taro.removeStorageSync('bind_id');
|
||||
isLogin.value = true;
|
||||
},
|
||||
complete: () => {
|
||||
Taro.hideLoading();
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
4
src/pages/marketing/yq/index.config.ts
Normal file
4
src/pages/marketing/yq/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '',
|
||||
navigationStyle: 'custom',
|
||||
});
|
||||
32
src/pages/marketing/yq/index.scss
Normal file
32
src/pages/marketing/yq/index.scss
Normal file
@@ -0,0 +1,32 @@
|
||||
page {
|
||||
background-image: url('https://pic.imgdb.cn/item/6697ab53d9c307b7e95e032c.png');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: 140px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
background-image: linear-gradient(
|
||||
90deg,
|
||||
rgb(254, 43, 34) 0%,
|
||||
rgb(255, 193, 0) 100%
|
||||
);
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.stock {
|
||||
width: 140px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
border: 0.5px solid rgba(254, 46, 33, 1);
|
||||
color: rgba(254, 46, 33, 1);
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
127
src/pages/marketing/yq/index.vue
Normal file
127
src/pages/marketing/yq/index.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view class="flex flex-col items-center pt-[208px]">
|
||||
<back />
|
||||
<image
|
||||
class="h-[800px] mb-[10px] w-full"
|
||||
src="https://pic.imgdb.cn/item/6697ac7bd9c307b7e95f3f39.png"
|
||||
mode="scaleToFill" />
|
||||
|
||||
<view class="bg-white p-[20px] w-[700px] rounded-[20px]">
|
||||
<view class="flex flex-col" v-if="data.length > 0">
|
||||
<view class="mb-[20px] flex" v-for="(item, index) in data" :key="index">
|
||||
<image
|
||||
class="w-[200px] h-[200px] rounded-[10px] mr-[10px]"
|
||||
:src="item.cover"
|
||||
mode="scaleToFill" />
|
||||
<view class="flex-1 flex flex-col justify-between">
|
||||
<view>
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:rows="2"
|
||||
style="font-size: 20px"
|
||||
:content="item.name"></nut-ellipsis>
|
||||
<view class="flex items-center mt-[10px]">
|
||||
<view class="tag">直播摇球机</view>
|
||||
<view class="stock">剩余: {{ item.stock }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="flex justify-between items-center bg-[#FEF3F1] rounded-full w-full h-[70px] pl-[20px]">
|
||||
<view class="flex">
|
||||
<view class="text-[#F83D3D] text-[28px] font-bold"
|
||||
>{{ item.number }}元</view
|
||||
>
|
||||
<view class="text-[#F83D3D] text-[28px] font-bold ml-[20px]"
|
||||
>{{ item.exchange }}积分</view
|
||||
>
|
||||
</view>
|
||||
<nut-button type="primary" size="small" @click="toPay(item)">
|
||||
<view class="flex items-center">
|
||||
<view class="pr-[5px] text-[28px]">购买</view>
|
||||
<RectRight size="15" />
|
||||
</view>
|
||||
</nut-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else image="empty" description="暂时没有商品"></nut-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getHdOrJfGoods, createActiveOrder} from '@/api/goods';
|
||||
import {getUserPoint} from '@/api/admin';
|
||||
import {addCart} from '@/api/cart';
|
||||
import Back from '@/components/Back.vue';
|
||||
import {RectRight} from '@nutui/icons-vue-taro';
|
||||
import './index.scss';
|
||||
|
||||
const data = ref<any[]>([]);
|
||||
|
||||
Taro.useLoad(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
const page = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
itemCount: 0,
|
||||
});
|
||||
|
||||
const getList = async () => {
|
||||
Taro.showLoading({
|
||||
title: '加载中',
|
||||
});
|
||||
const res = await getHdOrJfGoods({
|
||||
PageNum: page.value.page,
|
||||
PageSize: page.value.pageSize,
|
||||
type: 3,
|
||||
});
|
||||
data.value.push(...res.data.data);
|
||||
page.value.itemCount = res.data.total;
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
Taro.useReachBottom(() => {
|
||||
if (page.value.page < Math.ceil(page.value.itemCount / page.value.pageSize)) {
|
||||
page.value.page++;
|
||||
getList();
|
||||
}
|
||||
});
|
||||
|
||||
const toPay = async item => {
|
||||
const tk = Taro.getStorageSync('token');
|
||||
if (!tk) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/login/index?isBack=1',
|
||||
});
|
||||
return;
|
||||
}
|
||||
await addCart({
|
||||
Bid: item.Store.bid,
|
||||
Gid: item.gid,
|
||||
Number: 1,
|
||||
});
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = await getUserPoint({
|
||||
phone: user_info.data.phone,
|
||||
bid: item.Store.bid,
|
||||
});
|
||||
|
||||
const res = await createActiveOrder({
|
||||
Bid: [item.Store.bid],
|
||||
custID: data.data.store_user_id,
|
||||
});
|
||||
|
||||
Taro.navigateTo({
|
||||
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${item.Store.bid}&OrderType=1`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
@@ -173,7 +173,7 @@ const closePicker = () => {
|
||||
<view>
|
||||
<view class="text-[28px]">订单号: {{ item.oid }}</view>
|
||||
<view class="text-[#484848] text-[26px] mt-[18px]">{{
|
||||
dayjs(item.add_time).format('YYYY/MM/DD mm:ss')
|
||||
dayjs(item.add_time).format('YYYY/MM/DD HH:mm:ss')
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="flex-1 text-right mt-[18px]">
|
||||
@@ -192,7 +192,9 @@ const closePicker = () => {
|
||||
<view>
|
||||
<view class="text-[28px]">订单:{{ item.oid }}</view>
|
||||
<view class="text-[#484848] text-[26px] mt-[18px]"
|
||||
>时间:{{ item.add_time.slice(0, 10) }}</view
|
||||
>时间:{{
|
||||
dayjs(item.add_time).format('YYYY/MM/DD HH:mm:ss')
|
||||
}}</view
|
||||
>
|
||||
</view>
|
||||
<view class="flex-1 text-right mt-[18px]">
|
||||
@@ -213,7 +215,9 @@ const closePicker = () => {
|
||||
<view>
|
||||
<view class="text-[28px]">订单:{{ item.oid }}</view>
|
||||
<view class="text-[#484848] text-[26px] mt-[18px]"
|
||||
>时间:{{ item.add_time.slice(0, 10) }}</view
|
||||
>时间:{{
|
||||
dayjs(item.add_time).format('YYYY/MM/DD HH:mm:ss')
|
||||
}}</view
|
||||
>
|
||||
</view>
|
||||
<view class="flex-1 text-right mt-[18px]">
|
||||
@@ -230,7 +234,9 @@ const closePicker = () => {
|
||||
<view>
|
||||
<view class="text-[28px]">类型:{{ computerType(item.type) }}</view>
|
||||
<view class="text-[#484848] text-[26px] mt-[18px]"
|
||||
>时间:{{ item.add_time.slice(0, 10) }}</view
|
||||
>时间:{{
|
||||
dayjs(item.add_time).format('YYYY/MM/DD HH:mm:ss')
|
||||
}}</view
|
||||
>
|
||||
</view>
|
||||
<view class="flex-1 text-right mt-[18px]">
|
||||
@@ -291,7 +297,5 @@ const closePicker = () => {
|
||||
align-items: center;
|
||||
font-size: 25px;
|
||||
margin-bottom: 25px;
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import UserModal from "@/components/UserModal.vue";
|
||||
import { ref } from "vue";
|
||||
import { getPhone, login } from "@/api/user";
|
||||
import logoImg from "../../../static/logo.jpg";
|
||||
import Taro from '@tarojs/taro';
|
||||
import UserModal from '@/components/UserModal.vue';
|
||||
import {ref} from 'vue';
|
||||
import {getPhone, login, getPersonalInfo} from '@/api/user';
|
||||
import logoImg from '../../../static/logo.jpg';
|
||||
|
||||
const isShow = ref(false);
|
||||
|
||||
@@ -12,17 +12,17 @@ const val = ref(false);
|
||||
const getCode = () => {
|
||||
if (!val.value)
|
||||
return Taro.showToast({
|
||||
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
|
||||
icon: "none",
|
||||
title: '请先阅读并同意用户协议&隐私政策&积分使用规则',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.showLoading({
|
||||
title: "授权中...",
|
||||
title: '授权中...',
|
||||
mask: true,
|
||||
});
|
||||
Taro.login({
|
||||
success: (res) => {
|
||||
success: res => {
|
||||
console.log(res);
|
||||
Taro.setStorageSync("wx_code", res.code);
|
||||
Taro.setStorageSync('wx_code', res.code);
|
||||
isShow.value = true;
|
||||
},
|
||||
complete: () => {
|
||||
@@ -32,51 +32,64 @@ const getCode = () => {
|
||||
};
|
||||
|
||||
const userInfo = ref({
|
||||
phone: "",
|
||||
phone: '',
|
||||
});
|
||||
|
||||
const optData = ref({});
|
||||
|
||||
Taro.useLoad(opt => {
|
||||
optData.value = opt;
|
||||
});
|
||||
|
||||
const getPhoneNumber = async (e: any) => {
|
||||
if (!val.value) {
|
||||
Taro.showToast({
|
||||
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
|
||||
icon: "none",
|
||||
title: '请先阅读并同意用户协议&隐私政策&积分使用规则',
|
||||
icon: 'none',
|
||||
});
|
||||
} else {
|
||||
Taro.showLoading({
|
||||
title: "授权手机号中",
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const { code } = e.detail;
|
||||
const {code} = e.detail;
|
||||
const res = await getPhone({
|
||||
code: code,
|
||||
});
|
||||
userInfo.value.phone = res.data.phone;
|
||||
if (!res.data.phone)
|
||||
return Taro.showToast({
|
||||
title: "手机号获取失败",
|
||||
icon: "none",
|
||||
title: '手机号获取失败',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.login({
|
||||
success: async (res) => {
|
||||
Taro.setStorageSync("wx_code", res.code);
|
||||
success: async res => {
|
||||
Taro.setStorageSync('wx_code', res.code);
|
||||
const ress = await login({
|
||||
Code: Taro.getStorageSync("wx_code"),
|
||||
Code: Taro.getStorageSync('wx_code'),
|
||||
Phone: userInfo.value.phone,
|
||||
Referee: Taro.getStorageSync("bind_id") || "",
|
||||
Referee: Taro.getStorageSync('bind_id') || '',
|
||||
});
|
||||
Taro.showToast({
|
||||
title: ress.msg,
|
||||
icon: "success",
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
});
|
||||
Taro.setStorageSync("token", ress.data.token);
|
||||
setTimeout(() => {
|
||||
Taro.removeStorageSync("wx_code");
|
||||
Taro.removeStorageSync("bind_id");
|
||||
Taro.switchTab({
|
||||
url: "/pages/user/index",
|
||||
Taro.setStorageSync('token', ress.data.token);
|
||||
if (optData.value.isBack) {
|
||||
await getUserInfo();
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 2000);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
Taro.removeStorageSync('wx_code');
|
||||
Taro.removeStorageSync('bind_id');
|
||||
Taro.switchTab({
|
||||
url: '/pages/user/index',
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
Taro.hideLoading();
|
||||
@@ -85,14 +98,28 @@ const getPhoneNumber = async (e: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getUserInfo = async () => {
|
||||
const res = await getPersonalInfo();
|
||||
const userInfo = {
|
||||
...res.data,
|
||||
data: {
|
||||
...res.data.data,
|
||||
permission: res.data.data.permission
|
||||
? JSON.parse(res.data.data.permission)
|
||||
: {},
|
||||
},
|
||||
};
|
||||
Taro.setStorageSync('userInfo', userInfo);
|
||||
};
|
||||
|
||||
const toPage = () => {
|
||||
if (!val.value)
|
||||
return Taro.showToast({
|
||||
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
|
||||
icon: "none",
|
||||
title: '请先阅读并同意用户协议&隐私政策&积分使用规则',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.navigateTo({
|
||||
url: "/pages/users/bindPhone/index?type=1",
|
||||
url: '/pages/users/bindPhone/index?type=1',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -132,8 +159,7 @@ const clickText = (type: number, text: string) => {
|
||||
隐私政策 </view
|
||||
>&<view
|
||||
style="color: #fa2c1a"
|
||||
@click.stop="clickText(3, '积分使用规则')"
|
||||
>
|
||||
@click.stop="clickText(3, '积分使用规则')">
|
||||
积分使用规则
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -107,6 +107,7 @@ Taro.useDidShow(() => {
|
||||
|
||||
const changeTabs = (index: number) => {
|
||||
tabsIndex.value = index;
|
||||
listData.value = [];
|
||||
get_list();
|
||||
};
|
||||
|
||||
|
||||
BIN
src/static/game_banner.png
Normal file
BIN
src/static/game_banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
Reference in New Issue
Block a user