迁移项目到cli模式
|
@ -0,0 +1,5 @@
|
|||
#请求url前缀
|
||||
# 中信建投
|
||||
# VITE_BASE_URL = 'http://zxjt.test.86698.cn'
|
||||
# 兴业优酷
|
||||
VITE_BASE_URL = 'http://192.168.110.39:8083'
|
|
@ -0,0 +1,5 @@
|
|||
#请求url前缀
|
||||
# 中信建投
|
||||
# VITE_BASE_URL = 'https://zxjt.86698.cn'
|
||||
# 兴业优酷
|
||||
VITE_BASE_URL = 'http://192.168.110.39:8083'
|
|
@ -0,0 +1,21 @@
|
|||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
|
@ -0,0 +1,51 @@
|
|||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import config from './custom.page.js'
|
||||
|
||||
const { pages, pagesInclude } = config
|
||||
|
||||
const getPages = () => {
|
||||
const srcPath = path.resolve(__dirname, pages)
|
||||
// console.log('00',srcPath);
|
||||
// console.log('01',fs.readdirSync(srcPath));
|
||||
//所有的模块
|
||||
const allModule = fs.readdirSync(srcPath);
|
||||
// console.log('allModule',allModule);
|
||||
//指定特定页面的模块
|
||||
const completeModule = pagesInclude.filter(item => item.indexOf('.vue') === -1)
|
||||
// console.log('completeModule',completeModule);
|
||||
//需要排除的整个模块
|
||||
const excludeModule = allModule.filter(item => !completeModule.includes(item))
|
||||
// console.log('excludeModule',excludeModule);
|
||||
//指定特定页面的模块
|
||||
const targetpageModule = pagesInclude.filter(item => item.indexOf('.vue') >= 0)
|
||||
// console.log(targetpageModule);
|
||||
const targetModule = targetpageModule.reduce((acc,cur) => {
|
||||
const [dir,file] = cur.split('/');
|
||||
if(Array.isArray(acc[dir])){
|
||||
acc[dir].push(file)
|
||||
}else{
|
||||
acc[dir] = [file]
|
||||
}
|
||||
return acc
|
||||
},{})
|
||||
// console.log(targetModule);
|
||||
// console.log(fs.readdirSync(path.resolve(__dirname,pages,'xyyk')));
|
||||
//需要排除的特定的页面
|
||||
const excludePages = [];
|
||||
Object.keys(targetModule).forEach((ele,index) => {
|
||||
if(excludeModule.includes(ele)){
|
||||
excludeModule.splice(excludeModule.indexOf(ele),1)
|
||||
}
|
||||
const targetPages = fs.readdirSync(path.resolve(__dirname,pages,ele)).filter(element => element.indexOf('.vue') >= 0)
|
||||
const targetExclude = targetPages.filter(elem => !targetModule[ele].includes(elem)).map(current => `${ele}/${current}`)
|
||||
excludePages.push(...targetExclude)
|
||||
})
|
||||
console.log('排除的模块以及页面',[...excludeModule,...excludePages]);
|
||||
return [...excludeModule,...excludePages]
|
||||
}
|
||||
|
||||
export default getPages
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
const config = {
|
||||
pages:'./src/pages',
|
||||
pagesInclude:['ycnc']
|
||||
}
|
||||
|
||||
export default config
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<!-- <script src="./static/YT_Client_api.js"></script> -->
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
<!-- 调试工具 -->
|
||||
<script src="https://fastly.jsdelivr.net/npm/eruda"></script>
|
||||
<script>eruda.init();</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"name": "uni-preset-vue",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev:app": "uni -p app",
|
||||
"dev:app-android": "uni -p app-android",
|
||||
"dev:app-ios": "uni -p app-ios",
|
||||
"dev:custom": "uni -p",
|
||||
"dev:h5": "uni",
|
||||
"dev:h5:ssr": "uni --ssr",
|
||||
"dev:mp-alipay": "uni -p mp-alipay",
|
||||
"dev:mp-baidu": "uni -p mp-baidu",
|
||||
"dev:mp-jd": "uni -p mp-jd",
|
||||
"dev:mp-kuaishou": "uni -p mp-kuaishou",
|
||||
"dev:mp-lark": "uni -p mp-lark",
|
||||
"dev:mp-qq": "uni -p mp-qq",
|
||||
"dev:mp-toutiao": "uni -p mp-toutiao",
|
||||
"dev:mp-weixin": "uni -p mp-weixin",
|
||||
"dev:mp-xhs": "uni -p mp-xhs",
|
||||
"dev:quickapp-webview": "uni -p quickapp-webview",
|
||||
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
|
||||
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
|
||||
"build:app": "uni build -p app",
|
||||
"build:app-android": "uni build -p app-android",
|
||||
"build:app-ios": "uni build -p app-ios",
|
||||
"build:custom": "uni build -p",
|
||||
"build:h5": "uni build",
|
||||
"build:h5:ssr": "uni build --ssr",
|
||||
"build:mp-alipay": "uni build -p mp-alipay",
|
||||
"build:mp-baidu": "uni build -p mp-baidu",
|
||||
"build:mp-jd": "uni build -p mp-jd",
|
||||
"build:mp-kuaishou": "uni build -p mp-kuaishou",
|
||||
"build:mp-lark": "uni build -p mp-lark",
|
||||
"build:mp-qq": "uni build -p mp-qq",
|
||||
"build:mp-toutiao": "uni build -p mp-toutiao",
|
||||
"build:mp-weixin": "uni build -p mp-weixin",
|
||||
"build:mp-xhs": "uni build -p mp-xhs",
|
||||
"build:quickapp-webview": "uni build -p quickapp-webview",
|
||||
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
|
||||
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-app": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-app-plus": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-components": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-h5": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-alipay": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-baidu": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-jd": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-kuaishou": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-lark": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-qq": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-toutiao": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-weixin": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-mp-xhs": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-ui": "^1.5.5",
|
||||
"js-md5": "^0.8.3",
|
||||
"vue": "^3.4.21",
|
||||
"vue-i18n": "^9.1.9",
|
||||
"wot-design-uni": "^1.2.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dcloudio/types": "^3.4.8",
|
||||
"@dcloudio/uni-automator": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-4010520240507001",
|
||||
"@dcloudio/uni-stacktracey": "3.0.0-4010520240507001",
|
||||
"@dcloudio/vite-plugin-uni": "3.0.0-4010520240507001",
|
||||
"@uni-helper/vite-plugin-uni-pages": "^0.2.23",
|
||||
"@vue/runtime-core": "^3.4.21",
|
||||
"sass": "^1.77.5",
|
||||
"sass-loader": "^10.1.1",
|
||||
"unocss": "~0.58.9",
|
||||
"vite": "5.2.8"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
|
||||
|
||||
export default defineUniPages({
|
||||
// 你也可以定义 pages 字段,它具有最高的优先级。
|
||||
pages: [],
|
||||
globalStyle: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTextStyle: 'black',
|
||||
navigationBarTitleText: '首页',
|
||||
},
|
||||
easycom: {
|
||||
autoscan: true,
|
||||
custom: {
|
||||
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
|
||||
"^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue"
|
||||
},
|
||||
},
|
||||
})
|
|
@ -0,0 +1,10 @@
|
|||
/// <reference types='@dcloudio/types' />
|
||||
import 'vue'
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
type Hooks = App.AppInstance & Page.PageInstance;
|
||||
|
||||
interface ComponentCustomOptions extends Hooks {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function () {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function () {
|
||||
console.log('App Hide')
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
uni-page{
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
}
|
||||
uni-page-body{
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,18 @@
|
|||
import request from "../utils/request";
|
||||
|
||||
export const checkTradeNo = (params) => request({
|
||||
url:'/backend/zxjt_redpacket/orders/is_exist',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const getAccessPage = (params) => request({
|
||||
url:'/backend/zxjt_redpacket/orders/access_page',
|
||||
...params
|
||||
})
|
||||
|
||||
export const sendPacket = (params) => request({
|
||||
url:'/backend/zxjt_redpacket/orders/send_packet',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
|
@ -0,0 +1,31 @@
|
|||
import request from "../utils/request";
|
||||
|
||||
export const login = (params) => request({
|
||||
url:'/v1/xy/login',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const getProduceList = (params) => request({
|
||||
url:'/v1/auth/activity',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const goBuy = (params) => request({
|
||||
url:'/v1/auth/order/buy',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const getTicketList = (params) => request({
|
||||
url:'/v1/auth/order/list',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const queryOrder = (params) => request({
|
||||
url:'/v1/auth/order/query',
|
||||
...params
|
||||
})
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import request from "../utils/request";
|
||||
|
||||
|
||||
export const login = (params) => request({
|
||||
url:'/api/v1/UnionLogin',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const getProductList = (params) => request({
|
||||
url:'/api/v1/VoucherList',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const detail = (params) => request({
|
||||
url:'/api/v1/product/detail',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const getOrderList = (params) => request({
|
||||
url:'/api/v1/auth/order/list',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
||||
export const goPay = (params) => request({
|
||||
url:'/api/v1/auth/order/create',
|
||||
method:'POST',
|
||||
...params
|
||||
})
|
||||
|
|
@ -0,0 +1,454 @@
|
|||
/**
|
||||
* @author 何杰
|
||||
* @date 2016-08-01 12:00:00
|
||||
* @address www.yitong.com.cn
|
||||
* @mail hj@yitong.com.cn
|
||||
* @desc: 屹通客户端组件api
|
||||
*/
|
||||
var Fw = {}; Fw.device = {};
|
||||
Fw.device.Device = function () {
|
||||
var userAgent = navigator.userAgent;
|
||||
//ios 事件队列
|
||||
var eventQueue = [];
|
||||
return {
|
||||
//是否iOS设备
|
||||
is_ios: userAgent.indexOf('iPhone') > -1 || userAgent.indexOf('iPad') > -1,
|
||||
//是否Android设备
|
||||
is_android: userAgent.indexOf('Android') > -1,
|
||||
/**
|
||||
* ios
|
||||
* 注册事件
|
||||
* @param code 事件编码
|
||||
* @param options 参数
|
||||
*/
|
||||
addEvent : function(code, options) {
|
||||
if (options && code) {
|
||||
eventQueue.push(JSON.stringify({
|
||||
code : code,
|
||||
name : options
|
||||
}));
|
||||
}
|
||||
},
|
||||
/**
|
||||
* ios
|
||||
* 原生调用,从队列中获取事件
|
||||
* @returns {string}
|
||||
*/
|
||||
getEvent : function() {
|
||||
return eventQueue.length > 0 ? eventQueue.shift() : '0';
|
||||
}
|
||||
};
|
||||
}();
|
||||
/**
|
||||
* 供第三方调用API
|
||||
*/
|
||||
Fw.device.api = function () {
|
||||
var device = Fw.device.Device;
|
||||
return {
|
||||
|
||||
|
||||
/**
|
||||
* @brief 获取经纬度
|
||||
*/
|
||||
handCodeGetLocation : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("51",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getLocation(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief 获取用户信息
|
||||
*/
|
||||
getUserInfo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callback = fn;
|
||||
device.is_ios && device.addEvent("getUserInfo",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getUserInfo(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
getCustNo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getCustNo",fn);
|
||||
device.is_android && GetInfoJs.getCustNo(fn);
|
||||
},
|
||||
|
||||
initTitle : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("initTitle",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.initTitle(JSON.stringify(option));
|
||||
|
||||
},
|
||||
|
||||
setBackFun : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goBack",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack(JSON.stringify(option));
|
||||
},
|
||||
setRightButton : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("setRightButton",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.setRightButton(JSON.stringify(option));
|
||||
},
|
||||
getBackFun : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getBackFun",fn);
|
||||
device.is_android && GetInfoJs.getBackFun(option);
|
||||
},
|
||||
|
||||
|
||||
startRecordVoice : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("startRecordVoice",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.startRecordVoice();
|
||||
},
|
||||
stopRecordVoice : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("stopRecordVoice",fn);
|
||||
device.is_android && GetInfoJs.stopRecordVoice(fn);
|
||||
},
|
||||
getPhoneNo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getPhoneNo",fn);
|
||||
device.is_android && GetInfoJs.getPhoneNo(fn);
|
||||
},
|
||||
/**
|
||||
*扫一扫
|
||||
*/
|
||||
openScanPage : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToQrCode",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openScanPage();
|
||||
},
|
||||
/**
|
||||
*付款码
|
||||
*/
|
||||
openPaymentCode : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoPaymentCode",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openPaymentCode(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
gotoSystemPhone : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoSystemPhone",fn);
|
||||
device.is_android && GetInfoJs.gotoSystemPhone(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭当前页面
|
||||
*/
|
||||
goBack : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack();
|
||||
},
|
||||
|
||||
/**
|
||||
* 调用物理返回键
|
||||
*/
|
||||
nativeBack : function () {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
option = {};
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.nativeBack();
|
||||
},
|
||||
/**
|
||||
* 地图导航
|
||||
*/
|
||||
openMap : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("openMap",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openMap(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
gotoLoginCallback : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToLoginView",JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.gotoLoginCallback(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
loginStatus : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("loginStatus",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.loginStatus(JSON.stringify(option));
|
||||
},
|
||||
|
||||
|
||||
checkRecordVoicePermission : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkRecordVoicePermission(fn);
|
||||
},
|
||||
openMenu : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.gotoCommonlyUsedMenu(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 分享
|
||||
*/
|
||||
handCodeShare : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showShare(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief 拍照、相册
|
||||
*/
|
||||
handCodeGetPhotos : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.takePhotos(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 拍照
|
||||
*/
|
||||
openCamera : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.openCamera(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 相册
|
||||
*/
|
||||
photoAlbum : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.photoAlbum(JSON.stringify(option));
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @brief 复制到粘贴板
|
||||
*/
|
||||
pasteStringToSystem : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("pasteStringToSystem",fn);
|
||||
device.is_android && GetInfoJs.pasteStringToSystem(fn);
|
||||
},
|
||||
|
||||
queryAppFamily : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.queryAppFamily(fn);
|
||||
},
|
||||
|
||||
getHeaderImg : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.getHeaderImg(fn);
|
||||
},
|
||||
|
||||
getSystemVersion : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getEquipmentInfo",fn);
|
||||
device.is_android && GetInfoJs.getSystemVersion(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 跳转VUE
|
||||
*/
|
||||
goVUEPage : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("goToAresPage",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showShare(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
甘肃宁波观影
|
||||
*/
|
||||
checkDiscountLevel : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callbackCheckDiscountLevel";
|
||||
option.shopid = "1100529310001000001";
|
||||
option.sign = "bd91222d6fcff0de67dd28583926ae92"
|
||||
device.is_ios && device.addEvent("checkDiscountLevel",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkDiscountLevel(fn);
|
||||
},
|
||||
/**
|
||||
宁波活动
|
||||
*/
|
||||
checkBFMLevel : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callbackCheckBFMLevel";
|
||||
option.shopid = "1100529310001000009";
|
||||
device.is_ios && device.addEvent("checkBFMLevel",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkBFMLevel(option);
|
||||
},
|
||||
uploadThirdCertifyEvents : function (param ,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callBackUploadThirdCertifyEvents";
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("uploadThirdCertifyEvents",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.uploadThirdCertifyEvents(option);
|
||||
},
|
||||
checkUserChangeOrNoAndLoginStatus : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("checkUserChangeOrNoAndLoginStatus",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.checkUserChangeOrNoAndLoginStatus(JSON.stringify(option));
|
||||
},
|
||||
handCodePay : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("handCodePay",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.go2pay(JSON.stringify(option));
|
||||
},
|
||||
publicActivityEvents : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("publicActivityEvents",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.publicActivityEvents(JSON.stringify(option));
|
||||
},
|
||||
getNewAuthorization : function (param) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getNewAuthorization",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.getNewAuthorization(JSON.stringify(param));
|
||||
}
|
||||
}
|
||||
}();
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
import {
|
||||
createSSRApp
|
||||
} from "vue";
|
||||
import App from "./App.vue";
|
||||
import 'virtual:uno.css';
|
||||
import '@/lib/YT_Client_api.js'
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App);
|
||||
return {
|
||||
app,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"name" : "",
|
||||
"appid" : "",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion" : "3"
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/ycnc/index",
|
||||
"type": "home",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "奶茶活动"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ycnc/detail",
|
||||
"type": "page",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/ycnc/order",
|
||||
"type": "page",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "首页"
|
||||
},
|
||||
"easycom": {
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
|
||||
"^wd-(.*)": "wot-design-uni/components/wd-$1/wd-$1.vue"
|
||||
}
|
||||
},
|
||||
"subPackages": []
|
||||
}
|
|
@ -0,0 +1,202 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<!-- <view class='tips-text'>暂无可以领取的红包</view> -->
|
||||
<view class="tips-area">
|
||||
<image src="../../static/image/tips_bg.png" class="tips-img" mode="widthFix"></image>
|
||||
</view>
|
||||
<uni-popup ref="popupRef" type="center" :is-mask-click="false" :mask-click="false">
|
||||
<view class="popup-content">
|
||||
<view class="title">恭喜你提现成功!</view>
|
||||
<view class="number">{{num}}<text>元</text></view>
|
||||
<view class="tips">*24小时内在微信"服务通知"中领取</view>
|
||||
<view class="btn" @click="closePopup">
|
||||
<image src="../../static/image/popup_btn.png"></image>
|
||||
</view>
|
||||
<view class="close">
|
||||
<image src="../../static/image/ic_close.png" @click="closePopup"></image>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted } from 'vue';
|
||||
import {getQueryString} from '../../utils/utils'
|
||||
import { checkTradeNo,getAccessPage,sendPacket } from '../../api'
|
||||
const popupRef = ref(null)
|
||||
//红包金额
|
||||
const num = ref(0);
|
||||
//有code就代表是授权回调回来的
|
||||
const isRedirect = () => {
|
||||
return !!getQueryString('code')
|
||||
}
|
||||
onMounted(() => {
|
||||
const isRedir = isRedirect()
|
||||
if(!isRedir){
|
||||
const orderInfo = {
|
||||
tid:getQueryString('tid'),
|
||||
timeStamp:getQueryString('timeStamp'),
|
||||
sign:getQueryString('sign'),
|
||||
tradeNo:getQueryString('tradeNo'),
|
||||
};
|
||||
uni.setStorageSync('orderInfo',JSON.stringify(orderInfo));
|
||||
checkEvent()
|
||||
}else{
|
||||
sendEvent()
|
||||
}
|
||||
})
|
||||
//检查是否存在可领取红包
|
||||
const checkEvent = () => {
|
||||
const params = {tradeNo:getQueryString('tradeNo')}
|
||||
checkTradeNo({params}).then(res => {
|
||||
if(res.status === true){
|
||||
recieveEvent()
|
||||
}else{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '暂无可领取的红包!!!',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '暂无可领取的红包!!!',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
//发送红包的事件
|
||||
const sendEvent = () => {
|
||||
const orderInfo = JSON.parse(uni.getStorageSync('orderInfo'))
|
||||
const {tid,timeStamp,sign,tradeNo} = orderInfo
|
||||
const params = {
|
||||
tid:Number(tid),
|
||||
code:getQueryString('code'),
|
||||
timeStamp,
|
||||
sign,
|
||||
tradeNo,
|
||||
}
|
||||
sendPacket({params}).then(res => {
|
||||
//金额以分为单位,需要转换
|
||||
num.value = res.amount / 100
|
||||
popupRef.value.open()
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
//领取红包事件
|
||||
const recieveEvent = () => {
|
||||
const orderInfo = JSON.parse(uni.getStorageSync('orderInfo'))
|
||||
const {tid,timeStamp,sign,tradeNo} = orderInfo
|
||||
const url = `https://lsxdwx.access.86698.cn/?tid=${tid}&tradeNo=${tradeNo}`
|
||||
console.log(url);
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
const closePopup = () => {
|
||||
popupRef.value.close()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.content {
|
||||
width: 100vw;
|
||||
height:100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
background: url('../../static/image/bg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
box-sizing:border-box;
|
||||
padding-bottom:20rpx;
|
||||
.tips-text{
|
||||
color:#310000;
|
||||
font-size:40rpx;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
transform: translate(-50%,-50%);
|
||||
}
|
||||
.btn-area{
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
transform: translate(-50%,-50%);
|
||||
image{
|
||||
width:300rpx;
|
||||
height:100rpx;
|
||||
border-radius:100rpx;
|
||||
}
|
||||
}
|
||||
.tips-area{
|
||||
width:700rpx;
|
||||
margin-top:40rpx;
|
||||
.tips-img{
|
||||
display: block;
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.popup-content{
|
||||
width:750rpx;
|
||||
height:850rpx;
|
||||
background: url("../../static/image/popup_bg.png") no-repeat;
|
||||
background-size:100% 800rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding-top:230rpx;
|
||||
.title{
|
||||
font-weight:bolder;
|
||||
margin-bottom:20rpx;
|
||||
color:#0A0200;
|
||||
font-size:34rpx;
|
||||
}
|
||||
.number{
|
||||
color:#F71E00;
|
||||
font-size:90rpx;
|
||||
font-weight:bolder;
|
||||
margin-bottom:15rpx;
|
||||
> text{
|
||||
font-size:40rpx;
|
||||
}
|
||||
}
|
||||
.tips{
|
||||
color:#43403F;
|
||||
font-size:30rpx;
|
||||
margin-bottom:85rpx;
|
||||
opacity: 0.6;
|
||||
font-size:28rpx;
|
||||
font-weight:400;
|
||||
}
|
||||
.btn > image{
|
||||
width:300rpx;
|
||||
height:90rpx;
|
||||
}
|
||||
.close {
|
||||
margin-top:60rpx;
|
||||
> image {
|
||||
width:60rpx;
|
||||
height:60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<view class="product-container">
|
||||
<view class="product-tips">
|
||||
支付享立减1元
|
||||
</view>
|
||||
<view class="product-price display">
|
||||
<view class="price">
|
||||
¥<text>{{detail.price}}</text>/{{detail.brand}}
|
||||
</view>
|
||||
<view class="ori">
|
||||
原价{{detail.show_price}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="product-type display">
|
||||
{{detail.name}}
|
||||
</view>
|
||||
<view class="product-btn" @click="$emit('buy-event',detail)">
|
||||
立即购买
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
detail:{
|
||||
type:Object,
|
||||
require:true,
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.product-container{
|
||||
width:292rpx;
|
||||
height:318rpx;
|
||||
background: url('../../../static/xyyk/bg-product.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
margin-top:30rpx;
|
||||
.product-tips{
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #B05619;
|
||||
box-sizing: border-box;
|
||||
padding-left:40rpx;
|
||||
}
|
||||
.display{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.product-price{
|
||||
color: #FD613F;
|
||||
.price{
|
||||
font-weight: 400;
|
||||
font-size: 40rpx;
|
||||
text{
|
||||
font-weight:bold;
|
||||
font-size: 60rpx;
|
||||
}
|
||||
}
|
||||
.ori{
|
||||
font-size: 24rpx;
|
||||
color: #E18B72;
|
||||
font-weight:400;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
.product-type{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top:40rpx;
|
||||
}
|
||||
.product-btn{
|
||||
width: 218rpx;
|
||||
height: 60rpx;
|
||||
background: linear-gradient( 90deg, #FFD888 0%, #FFE39E 100%);
|
||||
border-radius: 30rpx;
|
||||
font-weight: 400;
|
||||
font-size: 30rpx;
|
||||
color: #A83203;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
margin:16rpx auto 0;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,80 @@
|
|||
<template>
|
||||
<view class="ticket-container">
|
||||
<view class="ticket-type">{{detail.product_name}}</view>
|
||||
<view class="ticket-content">
|
||||
<image src="../../../static/xyyk/icon-ticket.png" mode=""></image>
|
||||
<view class="ticket-name">{{detail.product_name}}</view>
|
||||
<view class="ticket-btn" @click="$emit('view-event',detail)">
|
||||
立即查看
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
detail:{
|
||||
type:Object,
|
||||
require:true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.ticket-container{
|
||||
width: 694rpx;
|
||||
height: 240rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx 24rpx 24rpx 24rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #1A1A1A;
|
||||
box-sizing: border-box;
|
||||
padding:32rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-top:32rpx;
|
||||
.ticket-type{
|
||||
width:100%;
|
||||
height:32rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #1A1A1A;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
.ticket-content{
|
||||
height:92rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
image{
|
||||
width:92rpx;
|
||||
height:92rpx;
|
||||
margin-right: 22rpx;
|
||||
}
|
||||
.ticket-name{
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
width:50%;
|
||||
overflow: hidden; /* 隐藏溢出内容 */
|
||||
text-overflow: ellipsis; /* 当文本溢出时显示省略号 */
|
||||
white-space: nowrap; /* 禁止文本换行 */
|
||||
}
|
||||
.ticket-btn{
|
||||
position: absolute;
|
||||
right:0;
|
||||
width: 150rpx;
|
||||
height: 54rpx;
|
||||
background: #47A5FF;
|
||||
border-radius: 27rpx;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height:54rpx ;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,240 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<image class="title" src="../../static/xyyk/bg-title.png" mode="widthFix"></image>
|
||||
<view class="tips">
|
||||
支付享立减1元
|
||||
</view>
|
||||
<view class="tickets" @click="toTickets">
|
||||
我的券包
|
||||
</view>
|
||||
<view class="bottom-banner">
|
||||
<view class="banner-title">
|
||||
兑换商品列表
|
||||
</view>
|
||||
<view class="banner-tips">
|
||||
<view>兴业优酷半价购送周卡</view>
|
||||
<view><text class="line"></text>支付享立减1元<text class="line"></text></view>
|
||||
</view>
|
||||
<scroll-view class="banner-content" scroll-y>
|
||||
<view class="banner-container">
|
||||
<view v-for="(item,index) in products" :key="item.id">
|
||||
<ProductItem :detail="item" @buy-event="handleBuy"/>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<uni-popup ref="popupRef" type="center" :is-mask-click="false" :mask-click="false">
|
||||
<view class="popup-content">
|
||||
<view class="popup-title">购买{{payResult ? '成功' : '失败'}}</view>
|
||||
<view class="popup-tips" v-if="payResult">恭喜购买成功,请稍后查看结果</view>
|
||||
<view class="popup-tips" v-else>支付失败了</view>
|
||||
<view class="btn" @click="closePopup">
|
||||
确定
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import ProductItem from './components/product-item';
|
||||
import {getQueryString} from '../../utils/utils';
|
||||
import {login,getProduceList,goBuy,queryOrder} from '../../api/xyyk';
|
||||
const popupRef = ref(null);
|
||||
const products = ref([]);
|
||||
const payResult = ref(false);
|
||||
const orderNo = "SN202406131136518803"
|
||||
const code = 'MDQ4MDM2ZWYwNzUxYmMwYmM3YTk4ZjdmNjEzZWNmOGNjZDk0OGQ5ZjM0NjY1NjY1NDMyYjY2MzVmNjkwZTE5MjU1MTdhOTc1MDkzOGVhMWJhNDE5YWVlMjQ5NGMwZjFmMTg4NzgyZDBiN2UyOGYwZDFjNzIzOGIzOTQ1ZGRiMWU0M2FiNjhjOTRlZjEyODE1MmM5NjIyMTQzZTBhYmQzZGFiOTRjM2ZhNTNlYTVlYTRiOGY0ZTIxZjFkN2I4ZjFlYzBmODQ1NzlmYTY2MDJmMmViZDIxMzc4ZDMwMmM1OGExZTZiMTQ1N2Y0MjY5NWJlNDRhZWU5YzE5OTViMmQ1MjAxNWY5NWM4ZTQ0OGI2NGEyZDI5MTkyNWNkZjA0YWIwZjFlZGE3MGJmZjk3YzViZTYwNTYzZDgxMjk2YmE5MWE4ZDQ0ZDZiZGY3MmJlMzdmN2NmMjI3YjU5NmQwNmMwYWM4MmZkYjc5MTk0MmRlNzE0NWU3ZmYxMGNkNjhmN2RhODMwMzU3NGUzMTM0ZGU3OTc1NWIwNDM0ODBmMjdlMzliZDEwZjViNWI4OTE1N2RhN2EzNmU5ZGNmZjQ3NzhiYjBhOGFmOTNlNTM2M2NiNmIzY2UwODJjZDU5NzFjMTVmZGI2ZA=='
|
||||
|
||||
onMounted(()=>{
|
||||
//页面连接中带code代表第一次进入页面,带订单号代表支付回调回来进入页面
|
||||
const code = getQueryString('code');
|
||||
const orderNo = getQueryString('order_no');
|
||||
if(code){
|
||||
getProductConfig()
|
||||
}else if(orderNo){
|
||||
queryOrderStatus()
|
||||
}
|
||||
})
|
||||
|
||||
const getProductConfig = async () => {
|
||||
const params = {data:code}
|
||||
const resData = await login({params})
|
||||
uni.setStorageSync('token',resData.token);
|
||||
const productConfig = await getProduceList();
|
||||
const {name,description,product} = productConfig;
|
||||
products.value = product;
|
||||
}
|
||||
|
||||
const queryOrderStatus = () => {
|
||||
const params = {
|
||||
order_no:orderNo
|
||||
}
|
||||
queryOrder({params}).then(res => {
|
||||
const {state} = res
|
||||
payResult.value = state == '2' ? true : false;
|
||||
popupRef.value.open()
|
||||
})
|
||||
}
|
||||
|
||||
const handleBuy = (item) => {
|
||||
const {id} = item;
|
||||
const params = {product_id:id}
|
||||
goBuy({params}).then(res => {
|
||||
const {payToken,payOrderId,mchtOrderId} = res;
|
||||
window.location.href = payToken;
|
||||
})
|
||||
}
|
||||
|
||||
const toTickets = () => {
|
||||
uni.navigateTo({url:'/pages/xyyk/tickets'})
|
||||
}
|
||||
|
||||
const closePopup = () => {
|
||||
popupRef.value.close()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container{
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
background: url('../../static/xyyk/bg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.title{
|
||||
width:640rpx;
|
||||
margin: 32rpx auto 0;
|
||||
}
|
||||
.tips{
|
||||
width: 215rpx;
|
||||
height: 42rpx;
|
||||
background: linear-gradient( 90deg, #E5F5FF 0%, #FFFEFF 100%);
|
||||
border-radius: 21rpx;
|
||||
margin-top:16rpx;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #00A5EB;
|
||||
text-align: center;
|
||||
line-height: 42rpx;
|
||||
}
|
||||
.tickets{
|
||||
position: fixed;
|
||||
right:0;
|
||||
top:150rpx;
|
||||
width: 102rpx;
|
||||
height: 32rpx;
|
||||
background: linear-gradient( 90deg, #E7F6FF 0%, #FEFEFF 100%);
|
||||
border-radius: 52rpx 0px 0px 52rpx;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #00A5EB;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
.bottom-banner{
|
||||
position: absolute;
|
||||
bottom:10rpx;
|
||||
width:730rpx;
|
||||
height:620rpx;
|
||||
background: url('../../static/xyyk/bg-banner.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.banner-title{
|
||||
width:350rpx;
|
||||
height:78rpx;
|
||||
text-align: center;
|
||||
line-height: 78rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
margin:0 auto;
|
||||
padding-left:50rpx;
|
||||
}
|
||||
.banner-tips{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top:30rpx;
|
||||
.line{
|
||||
display: block;
|
||||
width: 40rpx;
|
||||
height: 0;
|
||||
border: 1rpx solid #3F85BC;
|
||||
&:first-child{
|
||||
margin-right:14rpx;
|
||||
}
|
||||
&:last-child{
|
||||
margin-left:14rpx;
|
||||
}
|
||||
}
|
||||
> :first-child{
|
||||
font-weight: 600;
|
||||
font-size: 32rpx;
|
||||
color: #135BC3;
|
||||
}
|
||||
> :last-child{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #3F85BC;
|
||||
}
|
||||
}
|
||||
.banner-content{
|
||||
box-sizing: border-box;
|
||||
padding:0 60rpx 40rpx;
|
||||
flex:1;
|
||||
overflow: auto;
|
||||
.banner-container{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.popup-content{
|
||||
width:578rpx;
|
||||
height:700rpx;
|
||||
background: url("../../static/xyyk/bg-popup.png") no-repeat;
|
||||
background-size:100% 700rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding-top:290rpx;
|
||||
.popup-title{
|
||||
font-weight:600;
|
||||
color:#111B1F;
|
||||
font-size:60rpx;
|
||||
margin-top:24rpx;
|
||||
}
|
||||
.popup-tips{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #00A5EB;
|
||||
margin-top:34rpx;
|
||||
opacity: .6;
|
||||
}
|
||||
.btn{
|
||||
width: 236rpx;
|
||||
height: 72rpx;
|
||||
background: linear-gradient( 180deg, #57C3FB 7%, #2D98F7 100%);
|
||||
border-radius: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 72rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
margin-top:100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,66 @@
|
|||
<template>
|
||||
<scroll-view scroll-y="true" class="container" @scrolltolower="getNextPage">
|
||||
<view class="wrapper">
|
||||
<view v-for="(item,index) in list" :key="item.id">
|
||||
<TicketItem :detail="item" @view-event="handleView"/>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted , ref, unref } from 'vue';
|
||||
import TicketItem from './components/ticket-item';
|
||||
import {getTicketList} from '../../api/xyyk';
|
||||
|
||||
const page = ref(1);
|
||||
const pageSize = 10;
|
||||
const total = ref(0);
|
||||
const list = ref([]);
|
||||
|
||||
onMounted(()=> {
|
||||
const params = {
|
||||
page:unref(page),
|
||||
pageSize:unref(pageSize)
|
||||
}
|
||||
getTicketList({params}).then(res => {
|
||||
const {count,data} = res
|
||||
total.value = count;
|
||||
list.value = data;
|
||||
})
|
||||
})
|
||||
const isLastPage = () => unref(page) === Math.ceil(unref(total) / pageSize)
|
||||
|
||||
const getNextPage = () => {
|
||||
if(isLastPage()){
|
||||
console.log('已经是最后一页');
|
||||
return false;
|
||||
};
|
||||
const params = {
|
||||
page:unref(page) + 1,
|
||||
pageSize:unref(pageSize),
|
||||
}
|
||||
}
|
||||
|
||||
const handleView = (item) => {
|
||||
const {voucher_link} = item
|
||||
console.log(item)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container{
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
background-color: #f7f7f7;
|
||||
overflow-y: auto;
|
||||
.wrapper{
|
||||
width:100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-bottom:32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,31 @@
|
|||
<template>
|
||||
<view class="pro-container flex flex-wrap flex-justify-between box-border">
|
||||
<view v-for="(item,index) in products" :key="index">
|
||||
<ProductItem :detail="item"/>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import ProductItem from './product-item'
|
||||
const props = defineProps({
|
||||
products:{
|
||||
type:Array,
|
||||
required: true,
|
||||
default:() => ([])
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pro-container{
|
||||
//宽高相比于设计稿多加了30
|
||||
width:750rpx;
|
||||
// height:938rpx;
|
||||
padding:123rpx 60rpx 20rpx;
|
||||
background: url('../../../static/ycnc/bg-content.png') no-repeat;
|
||||
// background-size: 100% auto;
|
||||
background-size:cover ;
|
||||
margin-bottom:20rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,139 @@
|
|||
<template>
|
||||
<view class="order-item-wrapper flex flex-col box-border">
|
||||
<view class="nav-info flex flex-justify-between" >
|
||||
<view>订单编号:{{ detail.order_no }}</view>
|
||||
<view>{{ stateConfig[detail.state] }}</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view class="content flex">
|
||||
<image
|
||||
src=""
|
||||
class="pro-img"
|
||||
/>
|
||||
<view class="flex flex-1 flex-col">
|
||||
<view class="flex flex-justify-between name info-item">
|
||||
<view class="text-over">{{ detail.product_name }}</view>
|
||||
<!-- <view>¥{{ detail.order_no }}元</view> -->
|
||||
<view>¥5元</view>
|
||||
</view>
|
||||
<view class="flex flex-justify-between num">
|
||||
<view>数量</view>
|
||||
<!-- <view>x{{ detail.order_no }}</view> -->
|
||||
<view>x1</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">下单时间:2021-08-31 16:37:05</view>
|
||||
</view>
|
||||
<!-- <view class="btns flex flex-justify-end">
|
||||
<view class="btn del">删除订单</view>
|
||||
<view class="btn pay">立即付款</view>
|
||||
<view class="btn view">查看卡密</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
detail:{
|
||||
type:Object,
|
||||
required: true,
|
||||
default:() => ({})
|
||||
}
|
||||
})
|
||||
const stateConfig = {
|
||||
1: '待支付',
|
||||
2: '已支付',
|
||||
3: '充值完成',
|
||||
4: '充值异常',
|
||||
5: '订单核销',
|
||||
6: '退款中',
|
||||
7: '退款完成',
|
||||
8: '退款失败'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-item-wrapper{
|
||||
width: 702rpx;
|
||||
// height: 386rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding:24rpx;
|
||||
margin:24rpx 0 16rpx;
|
||||
}
|
||||
.nav-info{
|
||||
font-size:22rpx;
|
||||
font-weight:400;
|
||||
:first-child{
|
||||
color: #333333;
|
||||
}
|
||||
:last-child{
|
||||
color: #787878;
|
||||
}
|
||||
}
|
||||
.order-info{
|
||||
margin-top:24rpx;
|
||||
.content{
|
||||
margin-bottom:24rpx;
|
||||
font-weight: 400;
|
||||
.pro-img{
|
||||
display: block;
|
||||
width:90rpx;
|
||||
height:90rpx;
|
||||
border:1rpx solid red;
|
||||
margin-right:34rpx;
|
||||
}
|
||||
}
|
||||
.time{
|
||||
font-size: 22rpx;
|
||||
color: #6C6C6C;
|
||||
}
|
||||
.info-item{
|
||||
margin-bottom:12px
|
||||
}
|
||||
.text-over{
|
||||
max-width:80%;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.name{
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.num{
|
||||
font-size: 20rpx;
|
||||
color: #9E9E9E;
|
||||
}
|
||||
}
|
||||
.btns{
|
||||
border-top: 1rpx solid #F0E1E1;
|
||||
padding:36rpx 0 12rpx;
|
||||
margin-top:24rpx;
|
||||
.btn{
|
||||
width: 168rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 68rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
line-height: 64rpx;
|
||||
margin-left:48rpx;
|
||||
}
|
||||
.del{
|
||||
color: #545454;
|
||||
border: 2rpx solid #B9C8C7;
|
||||
}
|
||||
.pay{
|
||||
color: #FFFFFF;
|
||||
background: #EA0000;
|
||||
}
|
||||
.view{
|
||||
background: #FFFFFF;
|
||||
border-radius: 68rpx;
|
||||
border: 2rpx solid #EA0000;
|
||||
color:#EA0000;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,111 @@
|
|||
<template>
|
||||
<view class="pro-item-wrapper flex flex-col flex-justify-end box-border" @click="toDetail">
|
||||
<view class="brand">{{ detail.brandFlag }}</view>
|
||||
<view class="name">{{ detail.voucherTitle }}</view>
|
||||
<view class="flex flex-justify-between flex-items-end">
|
||||
<view class="price">{{ detail.voucherAmount }}<text>元</text>
|
||||
</view>
|
||||
<view class="ori">{{ detail.voucherOriginalPrice }}</view>
|
||||
</view>
|
||||
<view class="btn flex flex-justify-center flex-items-center">
|
||||
<view class="btn-content" @click="goBuy">点击购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
const clickBuy = inject('handleBuy');
|
||||
const goDetail = inject('goDetail');
|
||||
const props = defineProps({
|
||||
detail:{
|
||||
type:Object,
|
||||
required: true,
|
||||
default:() => ({})
|
||||
}
|
||||
})
|
||||
const goBuy = (e) => {
|
||||
e = e || window.event;
|
||||
if(e.stopPropagation) { //W3C阻止冒泡方法
|
||||
e.stopPropagation();
|
||||
}
|
||||
clickBuy(props.detail.ProductId)
|
||||
}
|
||||
const toDetail = (event) => {
|
||||
goDetail()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pro-item-wrapper{
|
||||
width:206rpx;
|
||||
height:370rpx;
|
||||
// background: url('../../../static/ycnc/bg-product.png') no-repeat;
|
||||
// background: url('/static/ycnc/bg-product.png') no-repeat;
|
||||
background: url('/static/ycnc/bg-product.jpg') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 0 16rpx 10rpx;
|
||||
margin-bottom:20rpx;
|
||||
}
|
||||
.brand{
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: #887F6E;
|
||||
|
||||
}
|
||||
.name{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #3B2609;
|
||||
margin:4rpx 0;
|
||||
}
|
||||
.price{
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
color: #F71924;
|
||||
text{
|
||||
font-size: 18rpx;
|
||||
}
|
||||
}
|
||||
.ori{
|
||||
font-weight: 300;
|
||||
font-size: 24rpx;
|
||||
color: #888365;
|
||||
text-decoration: line-through;
|
||||
text{
|
||||
font-size: 16rpx;
|
||||
// text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
// .btn{
|
||||
// width:166rpx;
|
||||
// height:66rpx;
|
||||
// background: url('../../../static/ycnc/bg-btn.png') no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
// font-weight: 400;
|
||||
// font-size: 26rpx;
|
||||
// color: #FFFFFF;
|
||||
// text-align: center;
|
||||
// line-height: 66rpx;
|
||||
// margin-top:12rpx;
|
||||
// }
|
||||
.btn{
|
||||
width: 166rpx;
|
||||
height: 56rpx;
|
||||
background: linear-gradient( 180deg, #FFF8EA 0%, #FFD9BC 100%);
|
||||
box-shadow: 0rpx 1 2rpx 0rpx #FAD5A8;
|
||||
border-radius: 28rpx;
|
||||
margin-top:18rpx;
|
||||
.btn-content {
|
||||
width: 158rpx;
|
||||
height: 48rpx;
|
||||
background: linear-gradient( 180deg, #FB3E3A 0%, #F01617 100%);
|
||||
border-radius: 24rpx;
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,130 @@
|
|||
<route lang="json5" type="page">
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '商品详情',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
|
||||
<template>
|
||||
<view class="w-full h-full flex flex-col">
|
||||
<scroll-view scroll-y class="w-full h-full overflow-y-auto flex-1">
|
||||
<view class="container">
|
||||
<image class="banner" :src="detailObj.main_image"></image>
|
||||
<view class="detail flex flex-col flex-justify-between">
|
||||
<view class="name">{{ detailObj.name }}</view>
|
||||
<view class="num">
|
||||
<text class="price">¥{{ detailObj.show_price }}</text>
|
||||
<text class="ori">{{ detailObj.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="notice">
|
||||
<view class="title">购买须知</view>
|
||||
<!-- <view>购买须知这一块的数据待商议</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="pay-btn" @="toPay">
|
||||
立即支付
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, unref } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { detail, goPay } from '../../api/ycnc'
|
||||
|
||||
const id = ref('')
|
||||
|
||||
const detailObj = reactive({})
|
||||
|
||||
onLoad((options) => {
|
||||
const {product_id} = options;
|
||||
id.value = product_id
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getDetail()
|
||||
})
|
||||
|
||||
const getDetail = () => {
|
||||
const params = {
|
||||
product_id:unref(id)
|
||||
}
|
||||
|
||||
detail({params}).then(res => {
|
||||
Object.assign(detailObj,res)
|
||||
})
|
||||
}
|
||||
|
||||
const pay = () => {
|
||||
const params = {
|
||||
product_id:unref(id)
|
||||
}
|
||||
goPay({params}).then(res => {
|
||||
const {respCode} = res;
|
||||
window.location.href = respCode
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.banner{
|
||||
width: 100%;
|
||||
height:600rpx;
|
||||
display: block;
|
||||
border: 1rpx solid red;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.detail{
|
||||
width: 694rpx;
|
||||
height: 138rpx;
|
||||
border-bottom: 2rpx solid rgba(0,0,0,0.04);
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
padding:25rpx 0;
|
||||
.name{
|
||||
font-weight: normal;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.price{
|
||||
font-weight: 700;
|
||||
font-size: 28rpx;
|
||||
color: #EA0000;
|
||||
margin-right:18rpx;
|
||||
}
|
||||
.ori{
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #A5A5A5;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
.notice{
|
||||
width: 694rpx;
|
||||
margin:0 auto;
|
||||
padding-top:40rpx;
|
||||
.title{
|
||||
font-weight: normal;
|
||||
font-size: 40rpx;
|
||||
color: #3D3D3D;
|
||||
}
|
||||
}
|
||||
.pay-btn{
|
||||
width: 600rpx;
|
||||
height: 88rpx;
|
||||
background: #EA0000;
|
||||
border-radius: 54rpx 54rpx 54rpx 54rpx;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
margin:25rpx auto;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,185 @@
|
|||
<route lang="json5" type="home">
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '奶茶活动',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
|
||||
<template>
|
||||
<scroll-view scroll-y class="page-wrapper">
|
||||
<view class="nav-btn" @click="toOrder">我的订单</view>
|
||||
<view class="wrapper flex flex-col flex-items-center box-border">
|
||||
<view v-for="(item,key) in productList" :key="key">
|
||||
<brand :products="item"/>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import brand from './components/brand';
|
||||
import md5 from 'js-md5';
|
||||
import { getProductList, goPay, login } from '../../api/ycnc'
|
||||
import { onMounted, ref, provide, unref } from 'vue';
|
||||
import { getQueryString , isIOS, isAndroid } from '../../utils/utils';
|
||||
|
||||
const productList = ref([]);
|
||||
const authCode = ref('');
|
||||
|
||||
const handleBuy = (product_id) => {
|
||||
pay(product_id)
|
||||
}
|
||||
|
||||
const goDetail = () => {
|
||||
uni.navigateTo({
|
||||
url:'/pages/ycnc/detail?product_id=1'
|
||||
})
|
||||
}
|
||||
|
||||
const pay = (id) => {
|
||||
const params = {
|
||||
product_id:id
|
||||
}
|
||||
goPay({params}).then(res => {
|
||||
const {order_no,notify_url} = res;
|
||||
payFunc({order_no,notify_url})
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
|
||||
provide('handleBuy', handleBuy);
|
||||
provide('goDetail', goDetail);
|
||||
|
||||
window.authoriCallback = (params) => {
|
||||
console.log('authoriCallback',params);
|
||||
const {code} = params;
|
||||
authCode.value = code;
|
||||
toLogin()
|
||||
|
||||
}
|
||||
|
||||
const getNewAuthorization = () => {
|
||||
let appId = "2vikrqptiia9pe9bf5ztrd";
|
||||
let time = Date.now().toString();
|
||||
let secret = '6fpfwdkgcggyk0yf2yb6bt';
|
||||
let signBefore = appId + time + secret;
|
||||
let sign = md5(signBefore);//普通md5
|
||||
let param = {
|
||||
appId: appId,
|
||||
sign: sign,
|
||||
time: time,
|
||||
tran_code: "104",
|
||||
fn: "authoriCallback",
|
||||
needBind: ""
|
||||
};
|
||||
console.log('auth-param104',param);
|
||||
Fw.device.api.getNewAuthorization(param)
|
||||
}
|
||||
|
||||
window.payCallback = (params) => {
|
||||
console.log('payCallback',params);
|
||||
}
|
||||
|
||||
const payFunc = (args) => {
|
||||
const {order_no,notify_url} = args;
|
||||
const params = {
|
||||
MercUrl:notify_url,
|
||||
TermSsn:order_no
|
||||
}
|
||||
console.log('handCodePay-params',params);
|
||||
if(isAndroid){
|
||||
Fw.device.api.handCodePay(params,payCallback)
|
||||
}else if(isIOS){
|
||||
Fw.device.api.handCodePay(params)
|
||||
}
|
||||
}
|
||||
|
||||
const toOrder = () => {
|
||||
uni.navigateTo({
|
||||
url:'/pages/ycnc/order'
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/ycnc/detail?product_id=1'
|
||||
// })
|
||||
};
|
||||
|
||||
const toLogin = () => {
|
||||
const params = {
|
||||
code: unref(authCode) || 'De0chzOWs6Zsi3fAo3vhFQ'
|
||||
}
|
||||
login({params}).then(res => {
|
||||
console.log(res);
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
toLogin()
|
||||
queryProducts()
|
||||
// window.authoriCallback = authoriCallback;
|
||||
// getNewAuthorization();
|
||||
});
|
||||
|
||||
function handleData(arg,args){
|
||||
return arg.reduce((total,current) =>{
|
||||
const flag = current.brandFlag;
|
||||
const flagData = args.filter(item => item.brandFlag === flag)
|
||||
if(Array.isArray(total[flag])){
|
||||
total[flag].push(...flagData)
|
||||
}else{
|
||||
total[flag] = [...flagData]
|
||||
}
|
||||
return total
|
||||
},{})
|
||||
}
|
||||
|
||||
//查询品牌,商品接口
|
||||
const queryProducts = () => {
|
||||
const params = {GID:'4894651'}
|
||||
getProductList({params}).then(res => {
|
||||
const {milkList,
|
||||
milkVoucherList} = res
|
||||
productList.value = handleData(milkList,milkVoucherList);
|
||||
}).catch(err=>{
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.page-wrapper{
|
||||
// width: 100vw;
|
||||
// height: 100vh;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.nav-btn{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top:42rpx;
|
||||
width: 42rpx;
|
||||
height: 132rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx 0rpx 0rpx 16rpx;
|
||||
font-weight: normal;
|
||||
font-size: 22rpx;
|
||||
color: #4BB8FF;
|
||||
writing-mode: vertical-lr;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.wrapper{
|
||||
width:100%;
|
||||
min-height:100%;
|
||||
background: url('../../static/ycnc/bg.png') no-repeat;
|
||||
background-size: 100% auto;
|
||||
padding-top:750rpx;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,115 @@
|
|||
<route lang="json5" type="page">
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '我的订单',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
|
||||
<template>
|
||||
<wd-tabs color="#333" inactiveColor="#888" @click="handleClick">
|
||||
<block v-for="item in tabs" :key="item.type">
|
||||
<wd-tab :title="item.tabName" :name="item.state">
|
||||
<scroll-view scroll-y class="page-wrapper">
|
||||
<view class="wrapper flex flex-col flex-items-center">
|
||||
<view v-for="(ele,index) in list" :key="ele.id">
|
||||
<OrderItem :detail="ele"/>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</wd-tab>
|
||||
</block>
|
||||
</wd-tabs>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import OrderItem from './components/order-item';
|
||||
import { getOrderList } from '../../api/ycnc';
|
||||
import { onMounted, ref, unref } from 'vue';
|
||||
|
||||
const page = ref(1);
|
||||
const pageSize = 10;
|
||||
const activeName = ref(0);
|
||||
const total = ref(0);
|
||||
const list = ref([]);
|
||||
|
||||
const tabs = [{
|
||||
tabName:'全部订单',
|
||||
state:0,
|
||||
},{
|
||||
tabName:'待付款',
|
||||
state:1,
|
||||
},{
|
||||
tabName:'处理中',
|
||||
state:2,
|
||||
},{
|
||||
tabName:'已完成',
|
||||
state:3,
|
||||
}];
|
||||
|
||||
const isLastPage = () => unref(page) === Math.ceil(unref(total) / pageSize)
|
||||
//获取订单列表
|
||||
const queryOrderList = () => {
|
||||
if(isLastPage()){
|
||||
console.log('已经是最后一页');
|
||||
return false;
|
||||
};
|
||||
const params = {
|
||||
page:unref(page),
|
||||
pageSize:pageSize,
|
||||
...(unref(activeName) !== 0 && {state:unref(activeName)})
|
||||
}
|
||||
getOrderList({params}).then(res => {
|
||||
const {count,data} = res
|
||||
total.value = count;
|
||||
list.value = data;
|
||||
}).catch(err => {
|
||||
total.value = 0;
|
||||
list.value = 0;
|
||||
})
|
||||
}
|
||||
|
||||
function handleClick({index, name}){
|
||||
page.value = 1;
|
||||
total.value = 0;
|
||||
activeName.value = name;
|
||||
// name代表状态值
|
||||
queryOrderList()
|
||||
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
queryOrderList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.page-wrapper{
|
||||
// width: 100vw;
|
||||
// height: 100vh;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.wrapper{
|
||||
width:100%;
|
||||
}
|
||||
/* 修改标签页下划线颜色*/
|
||||
:deep(.wd-tabs__line) {
|
||||
background: #EA0000;
|
||||
// width:64rpx !important;
|
||||
// height:4rpx !important;
|
||||
}
|
||||
:deep(.wd-tabs){
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height:100%;
|
||||
}
|
||||
:deep(.wd-tab),:deep(.wd-tab__body){
|
||||
height:100%;
|
||||
}
|
||||
:deep(.wd-tabs__container){
|
||||
flex:1;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,6 @@
|
|||
export {};
|
||||
|
||||
declare module "vue" {
|
||||
type Hooks = App.AppInstance & Page.PageInstance;
|
||||
interface ComponentCustomOptions extends Hooks {}
|
||||
}
|
|
@ -0,0 +1,454 @@
|
|||
/**
|
||||
* @author 何杰
|
||||
* @date 2016-08-01 12:00:00
|
||||
* @address www.yitong.com.cn
|
||||
* @mail hj@yitong.com.cn
|
||||
* @desc: 屹通客户端组件api
|
||||
*/
|
||||
var Fw = {}; Fw.device = {};
|
||||
Fw.device.Device = function () {
|
||||
var userAgent = navigator.userAgent;
|
||||
//ios 事件队列
|
||||
var eventQueue = [];
|
||||
return {
|
||||
//是否iOS设备
|
||||
is_ios: userAgent.indexOf('iPhone') > -1 || userAgent.indexOf('iPad') > -1,
|
||||
//是否Android设备
|
||||
is_android: userAgent.indexOf('Android') > -1,
|
||||
/**
|
||||
* ios
|
||||
* 注册事件
|
||||
* @param code 事件编码
|
||||
* @param options 参数
|
||||
*/
|
||||
addEvent : function(code, options) {
|
||||
if (options && code) {
|
||||
eventQueue.push(JSON.stringify({
|
||||
code : code,
|
||||
name : options
|
||||
}));
|
||||
}
|
||||
},
|
||||
/**
|
||||
* ios
|
||||
* 原生调用,从队列中获取事件
|
||||
* @returns {string}
|
||||
*/
|
||||
getEvent : function() {
|
||||
return eventQueue.length > 0 ? eventQueue.shift() : '0';
|
||||
}
|
||||
};
|
||||
}();
|
||||
/**
|
||||
* 供第三方调用API
|
||||
*/
|
||||
Fw.device.api = function () {
|
||||
var device = Fw.device.Device;
|
||||
return {
|
||||
|
||||
|
||||
/**
|
||||
* @brief 获取经纬度
|
||||
*/
|
||||
handCodeGetLocation : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("51",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getLocation(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief 获取用户信息
|
||||
*/
|
||||
getUserInfo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callback = fn;
|
||||
device.is_ios && device.addEvent("getUserInfo",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getUserInfo(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
getCustNo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getCustNo",fn);
|
||||
device.is_android && GetInfoJs.getCustNo(fn);
|
||||
},
|
||||
|
||||
initTitle : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("initTitle",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.initTitle(JSON.stringify(option));
|
||||
|
||||
},
|
||||
|
||||
setBackFun : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goBack",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack(JSON.stringify(option));
|
||||
},
|
||||
setRightButton : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("setRightButton",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.setRightButton(JSON.stringify(option));
|
||||
},
|
||||
getBackFun : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getBackFun",fn);
|
||||
device.is_android && GetInfoJs.getBackFun(option);
|
||||
},
|
||||
|
||||
|
||||
startRecordVoice : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("startRecordVoice",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.startRecordVoice();
|
||||
},
|
||||
stopRecordVoice : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("stopRecordVoice",fn);
|
||||
device.is_android && GetInfoJs.stopRecordVoice(fn);
|
||||
},
|
||||
getPhoneNo : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getPhoneNo",fn);
|
||||
device.is_android && GetInfoJs.getPhoneNo(fn);
|
||||
},
|
||||
/**
|
||||
*扫一扫
|
||||
*/
|
||||
openScanPage : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToQrCode",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openScanPage();
|
||||
},
|
||||
/**
|
||||
*付款码
|
||||
*/
|
||||
openPaymentCode : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoPaymentCode",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openPaymentCode(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
gotoSystemPhone : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoSystemPhone",fn);
|
||||
device.is_android && GetInfoJs.gotoSystemPhone(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭当前页面
|
||||
*/
|
||||
goBack : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack();
|
||||
},
|
||||
|
||||
/**
|
||||
* 调用物理返回键
|
||||
*/
|
||||
nativeBack : function () {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
option = {};
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.nativeBack();
|
||||
},
|
||||
/**
|
||||
* 地图导航
|
||||
*/
|
||||
openMap : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("openMap",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openMap(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
gotoLoginCallback : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToLoginView",JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.gotoLoginCallback(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
loginStatus : function (option) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("loginStatus",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.loginStatus(JSON.stringify(option));
|
||||
},
|
||||
|
||||
|
||||
checkRecordVoicePermission : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkRecordVoicePermission(fn);
|
||||
},
|
||||
openMenu : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.gotoCommonlyUsedMenu(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 分享
|
||||
*/
|
||||
handCodeShare : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showShare(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief 拍照、相册
|
||||
*/
|
||||
handCodeGetPhotos : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.takePhotos(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 拍照
|
||||
*/
|
||||
openCamera : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.openCamera(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 相册
|
||||
*/
|
||||
photoAlbum : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.photoAlbum(JSON.stringify(option));
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @brief 复制到粘贴板
|
||||
*/
|
||||
pasteStringToSystem : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("pasteStringToSystem",fn);
|
||||
device.is_android && GetInfoJs.pasteStringToSystem(fn);
|
||||
},
|
||||
|
||||
queryAppFamily : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.queryAppFamily(fn);
|
||||
},
|
||||
|
||||
getHeaderImg : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.getHeaderImg(fn);
|
||||
},
|
||||
|
||||
getSystemVersion : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getEquipmentInfo",fn);
|
||||
device.is_android && GetInfoJs.getSystemVersion(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 跳转VUE
|
||||
*/
|
||||
goVUEPage : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("goToAresPage",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showShare(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
甘肃宁波观影
|
||||
*/
|
||||
checkDiscountLevel : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callbackCheckDiscountLevel";
|
||||
option.shopid = "1100529310001000001";
|
||||
option.sign = "bd91222d6fcff0de67dd28583926ae92"
|
||||
device.is_ios && device.addEvent("checkDiscountLevel",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkDiscountLevel(fn);
|
||||
},
|
||||
/**
|
||||
宁波活动
|
||||
*/
|
||||
checkBFMLevel : function (fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callbackCheckBFMLevel";
|
||||
option.shopid = "1100529310001000009";
|
||||
device.is_ios && device.addEvent("checkBFMLevel",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkBFMLevel(option);
|
||||
},
|
||||
uploadThirdCertifyEvents : function (param ,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = "callBackUploadThirdCertifyEvents";
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("uploadThirdCertifyEvents",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.uploadThirdCertifyEvents(option);
|
||||
},
|
||||
checkUserChangeOrNoAndLoginStatus : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("checkUserChangeOrNoAndLoginStatus",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.checkUserChangeOrNoAndLoginStatus(JSON.stringify(option));
|
||||
},
|
||||
handCodePay : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("handCodePay",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.go2pay(JSON.stringify(option));
|
||||
},
|
||||
publicActivityEvents : function (param,fn) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("publicActivityEvents",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.publicActivityEvents(JSON.stringify(option));
|
||||
},
|
||||
getNewAuthorization : function (param) {
|
||||
if(!device.is_ios && !device.is_android){
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getNewAuthorization",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.getNewAuthorization(JSON.stringify(param));
|
||||
}
|
||||
}
|
||||
}();
|
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 243 B |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 268 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 91 KiB |
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
|
||||
/* 颜色变量 */
|
||||
|
||||
/* 行为相关颜色 */
|
||||
$uni-color-primary: #007aff;
|
||||
$uni-color-success: #4cd964;
|
||||
$uni-color-warning: #f0ad4e;
|
||||
$uni-color-error: #dd524d;
|
||||
|
||||
/* 文字基本颜色 */
|
||||
$uni-text-color: #333; // 基本色
|
||||
$uni-text-color-inverse: #fff; // 反色
|
||||
$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息
|
||||
$uni-text-color-placeholder: #808080;
|
||||
$uni-text-color-disable: #c0c0c0;
|
||||
|
||||
/* 背景颜色 */
|
||||
$uni-bg-color: #fff;
|
||||
$uni-bg-color-grey: #f8f8f8;
|
||||
$uni-bg-color-hover: #f1f1f1; // 点击状态颜色
|
||||
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色
|
||||
|
||||
/* 边框颜色 */
|
||||
$uni-border-color: #c8c7cc;
|
||||
|
||||
/* 尺寸变量 */
|
||||
|
||||
/* 文字尺寸 */
|
||||
$uni-font-size-sm: 12px;
|
||||
$uni-font-size-base: 14px;
|
||||
$uni-font-size-lg: 16;
|
||||
|
||||
/* 图片尺寸 */
|
||||
$uni-img-size-sm: 20px;
|
||||
$uni-img-size-base: 26px;
|
||||
$uni-img-size-lg: 40px;
|
||||
|
||||
/* Border Radius */
|
||||
$uni-border-radius-sm: 2px;
|
||||
$uni-border-radius-base: 3px;
|
||||
$uni-border-radius-lg: 6px;
|
||||
$uni-border-radius-circle: 50%;
|
||||
|
||||
/* 水平间距 */
|
||||
$uni-spacing-row-sm: 5px;
|
||||
$uni-spacing-row-base: 10px;
|
||||
$uni-spacing-row-lg: 15px;
|
||||
|
||||
/* 垂直间距 */
|
||||
$uni-spacing-col-sm: 4px;
|
||||
$uni-spacing-col-base: 8px;
|
||||
$uni-spacing-col-lg: 12px;
|
||||
|
||||
/* 透明度 */
|
||||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
|
||||
|
||||
/* 文章场景相关 */
|
||||
$uni-color-title: #2c405a; // 文章标题颜色
|
||||
$uni-font-size-title: 20px;
|
||||
$uni-color-subtitle: #555; // 二级标题颜色
|
||||
$uni-font-size-subtitle: 18px;
|
||||
$uni-color-paragraph: #3f536e; // 文章段落颜色
|
||||
$uni-font-size-paragraph: 15px;
|
|
@ -0,0 +1,69 @@
|
|||
const baseUrl = import.meta.env.VITE_BASE_URL
|
||||
|
||||
function request(options) {
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true,
|
||||
});
|
||||
let defaultHeader = {
|
||||
|
||||
}
|
||||
// // 如果使用params传参则,以&符拼接的格式传参
|
||||
if (options.params) {
|
||||
options.data = options.params
|
||||
// defaultHeader['Content-Type'] = 'application/json'
|
||||
defaultHeader['Content-Type'] = 'application/x-www-form-urlencoded'
|
||||
}
|
||||
const token = uni.getStorageSync('token');
|
||||
if (token) {
|
||||
defaultHeader.Authorization = `Bearer ${token}`
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: baseUrl + options.url, // 接口地址:前缀+方法中传入的地址
|
||||
method: options.method || 'GET', // 请求方法:传入的方法或者默认是“GET”
|
||||
data: options.data || {}, // 传递参数:传入的参数或者默认传递空集合
|
||||
header: {
|
||||
...defaultHeader,
|
||||
...options.header
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.statusCode && res.statusCode != 200) {
|
||||
uni.hideLoading().then(() => {
|
||||
uni.showToast({
|
||||
title: "api错误" + res.errMsg,
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
reject()
|
||||
} else {
|
||||
const resData = res.data
|
||||
if (resData.code == 200) {
|
||||
uni.hideLoading()
|
||||
resolve(resData.data)
|
||||
} else {
|
||||
uni.hideLoading().then(() => {
|
||||
uni.showToast({
|
||||
title: '请求失败了,稍后再试',
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
reject(res.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 这里的接口请求,如果出现问题就输出接口请求失败
|
||||
fail: (err) => {
|
||||
uni.hideLoading().then(() => {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export default request
|
|
@ -0,0 +1,13 @@
|
|||
//获取url后面拼接的参数
|
||||
export const getQueryString = (name) => {
|
||||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) return unescape(r[2]);
|
||||
return null;
|
||||
}
|
||||
|
||||
//是否iOS设备
|
||||
export const isIOS = () => userAgent.indexOf('iPhone') > -1 || userAgent.indexOf('iPad') > -1;
|
||||
|
||||
//是否Android设备
|
||||
export const isAndroid = () => userAgent.indexOf('Android') > -1;
|
|
@ -0,0 +1,716 @@
|
|||
/**
|
||||
* @author 何杰
|
||||
* @date 2016-08-01 12:00:00
|
||||
* @address www.yitong.com.cn
|
||||
* @mail hj@yitong.com.cn
|
||||
* @desc: 屹通客户端组件api
|
||||
*/
|
||||
var Fw = {};
|
||||
Fw.device = {};
|
||||
Fw.device.Device = function () {
|
||||
var userAgent = navigator.userAgent;
|
||||
//ios 事件队列
|
||||
var eventQueue = [];
|
||||
return {
|
||||
//是否iOS设备
|
||||
is_ios: userAgent.indexOf('iPhone') > -1 || userAgent.indexOf('iPad') > -1,
|
||||
//是否Android设备
|
||||
is_android: userAgent.indexOf('Android') > -1,
|
||||
/**
|
||||
* ios
|
||||
* 注册事件
|
||||
* @param code 事件编码
|
||||
* @param options 参数
|
||||
*/
|
||||
addEvent: function (code, options) {
|
||||
if (options && code) {
|
||||
eventQueue.push(JSON.stringify({
|
||||
code: code,
|
||||
name: options
|
||||
}));
|
||||
}
|
||||
},
|
||||
/**
|
||||
* ios
|
||||
* 原生调用,从队列中获取事件
|
||||
* @returns {string}
|
||||
*/
|
||||
getEvent: function () {
|
||||
return eventQueue.length > 0 ? eventQueue.shift() : '0';
|
||||
}
|
||||
};
|
||||
}
|
||||
();
|
||||
/**
|
||||
* 供第三方调用API
|
||||
*/
|
||||
Fw.device.api = function () {
|
||||
var device = Fw.device.Device;
|
||||
return {
|
||||
|
||||
|
||||
/**
|
||||
* @brief 获取经纬度
|
||||
* "X_LINE"和 "Y_LINE"两个返回字段在Android5.0.6及以后才会出现
|
||||
*
|
||||
*/
|
||||
handCodeGetLocation: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("51", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getLocation(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 获取用户信息
|
||||
*/
|
||||
getUserInfo: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callback = fn;
|
||||
device.is_ios && device.addEvent("getUserInfo", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getUserInfo(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief
|
||||
*/
|
||||
getCustNo: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getCustNo", fn);
|
||||
device.is_android && GetInfoJs.getCustNo(fn);
|
||||
},
|
||||
|
||||
initTitle: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("initTitle", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.initTitle(JSON.stringify(option));
|
||||
},
|
||||
|
||||
setRightButton: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("setRightButton", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.setRightButton(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
setBackFun: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goBack", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack(JSON.stringify(option));
|
||||
},
|
||||
getBackFun: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getBackFun", fn);
|
||||
device.is_android && GetInfoJs.getBackFun(option);
|
||||
},
|
||||
|
||||
startRecordVoice: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("startRecordVoice", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.startRecordVoice();
|
||||
},
|
||||
stopRecordVoice: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("stopRecordVoice", fn);
|
||||
device.is_android && GetInfoJs.stopRecordVoice(fn);
|
||||
},
|
||||
getPhoneNo: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getPhoneNo", fn);
|
||||
device.is_android && GetInfoJs.getPhoneNo(fn);
|
||||
},
|
||||
/**
|
||||
*扫一扫
|
||||
*/
|
||||
openScanPage: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToQrCode", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openScanPage();
|
||||
},
|
||||
/**
|
||||
*付款码
|
||||
*/
|
||||
openPaymentCode: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoPaymentCode", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openPaymentCode(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 拨打电话
|
||||
*/
|
||||
gotoSystemPhone: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("gotoSystemPhone", fn);
|
||||
device.is_android && GetInfoJs.gotoSystemPhone(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭当前页面
|
||||
*/
|
||||
goBack: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("backPrevious", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.goBack();
|
||||
},
|
||||
|
||||
/**
|
||||
* 调用物理返回键
|
||||
*/
|
||||
nativeBack: function () {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
option = {};
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.nativeBack();
|
||||
},
|
||||
/**
|
||||
* 地图导航
|
||||
*/
|
||||
openMap: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("openMap", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.openMap(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
gotoLoginCallback: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToLoginView", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.gotoLoginCallback(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
loginStatus: function (option) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("loginStatus", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.loginStatus(JSON.stringify(option));
|
||||
},
|
||||
|
||||
checkRecordVoicePermission: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkRecordVoicePermission(fn);
|
||||
},
|
||||
openMenu: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
// device.is_ios && device.addEvent("getBackFun",JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.gotoCommonlyUsedMenu(fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 分享
|
||||
*/
|
||||
handCodeShare: function (param, fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("41", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showShare(JSON.stringify(option));
|
||||
},
|
||||
/**
|
||||
* @brief 拍照、相册
|
||||
*/
|
||||
handCodeGetPhotos: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
device.is_ios && device.addEvent("41", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.takePhotos(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 拍照
|
||||
*/
|
||||
openCamera: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.openCamera(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 相册
|
||||
*/
|
||||
photoAlbum: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
// device.is_ios && device.addEvent("41",JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.photoAlbum(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 复制到粘贴板
|
||||
*/
|
||||
pasteStringToSystem: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
|
||||
device.is_ios && device.addEvent("pasteStringToSystem", fn);
|
||||
device.is_android && GetInfoJs.pasteStringToSystem(fn);
|
||||
},
|
||||
|
||||
queryAppFamily: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.queryAppFamily(fn);
|
||||
},
|
||||
|
||||
getHeaderImg: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
//TODO ios粘贴方法
|
||||
|
||||
device.is_android && GetInfoJs.getHeaderImg(fn);
|
||||
},
|
||||
|
||||
getSystemVersion: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getVersionCode", fn);
|
||||
device.is_android && GetInfoJs.getSystemVersion(fn);
|
||||
},
|
||||
getChooseCityInfo: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("getChooseCityInfo", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.getChooseCityInfo(JSON.stringify(option));
|
||||
},
|
||||
|
||||
faceCheck: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("faceCheck", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.faceCheck(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 跳转VUE
|
||||
*/
|
||||
goVUEPage: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("goToAresPage", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.goToAresPage(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 跳转制定页面
|
||||
*/
|
||||
loadPath: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("loadPath", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.loadPath(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 跳转VUE
|
||||
*/
|
||||
redirectPage: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("redirectPage", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.redirectPage(JSON.stringify(param));
|
||||
},
|
||||
/**
|
||||
* @brief 积分接口
|
||||
*/
|
||||
jifenGetCordDateInfo: function (fun) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var param = {};
|
||||
param.fn = fun
|
||||
device.is_ios && device.addEvent("jifenGetCordDateInfo", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.jifenGetCordDateInfo(JSON.stringify(param));
|
||||
},
|
||||
|
||||
getEquipmentInfo: function (fun) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var param = {};
|
||||
param.fn = fun
|
||||
device.is_ios && device.addEvent("getEquipmentInfo", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.getEquipmentInfo(JSON.stringify(param));
|
||||
},
|
||||
|
||||
getOnLineFaCard: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getOnLineFaCard", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.getOnLineFaCard(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 获取经纬度
|
||||
* "longitude" 和 "latitude" 两个返回字段再Android5.0.6及以后才会出现
|
||||
*/
|
||||
checkAndGetLocation: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("checkAndGetLocation", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkAndGetLocation2(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
*开启截屏监听
|
||||
*/
|
||||
startMonitoring: function () {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
device.is_ios && device.addEvent("startMonitoring", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.startMonitoring();
|
||||
},
|
||||
|
||||
/**
|
||||
*关闭截屏监听
|
||||
*/
|
||||
endMonitoring: function () {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
device.is_ios && device.addEvent("endMonitoring", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.endMonitoring();
|
||||
},
|
||||
|
||||
/**
|
||||
*更新优惠券数量
|
||||
*/
|
||||
updateCoupon: function () {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
device.is_ios && device.addEvent("updateCoupon", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.updateCoupon();
|
||||
},
|
||||
|
||||
/**
|
||||
*荣数用户检测
|
||||
*/
|
||||
checkUserChangeOrNot: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("checkUserChangeOrNot", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.checkUserChangeOrNot(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
*跳转页面(届管数据)
|
||||
*/
|
||||
redirectPage: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("redirectPage", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.redirectPage(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
* 检测权限
|
||||
*/
|
||||
checkPermission: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("checkPermission", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.checkPermission(JSON.stringify(param));
|
||||
},
|
||||
|
||||
/**
|
||||
* 申请权限
|
||||
*/
|
||||
requestPermission: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("requestPermission", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.requestPermission(JSON.stringify(param));
|
||||
},
|
||||
|
||||
setPhoneCallStateListener: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("setPhoneCallStateListener", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.setPhoneCallStateListener(JSON.stringify(param));
|
||||
},
|
||||
|
||||
setAudioStreamType: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("setAudioStreamType", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.setAudioStreamType(JSON.stringify(param));
|
||||
},
|
||||
|
||||
showFloatWindow: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("showFloatWindow", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.showFloatWindow(JSON.stringify(param));
|
||||
},
|
||||
|
||||
getUserInfoForVideoCall: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("getUserInfoForVideoCall", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.getUserInfoForVideoCall(JSON.stringify(param));
|
||||
},
|
||||
|
||||
buriedPoint: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("buriedPoint", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.buriedPoint(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
zxkf_goToLogin: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("zxkf_goToLogin", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.zxkf_goToLogin(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
checkUnionPayAuthState: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("checkUnionPayAuthState", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.checkUnionPayAuthState(JSON.stringify(fn));
|
||||
},
|
||||
|
||||
startQrPay: function () {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("startQrPay", "");
|
||||
device.is_android && GetInfoJs.startQrPay();
|
||||
},
|
||||
|
||||
openQRCodeCombineUnionPay: function (param) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("openQRCodeCombineUnionPay", "");
|
||||
device.is_android && GetInfoJs.openQRCodeCombineUnionPay(param);
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 打开消息推送弹窗
|
||||
*/
|
||||
openPushAlert: function (param, fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
option.param = param;
|
||||
device.is_ios && device.addEvent("openPushAlert", JSON.stringify(param));
|
||||
device.is_android && GetInfoJs.openPushAlert(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 检测个性化消息推荐开关
|
||||
*/
|
||||
personalPushOpenType: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("personalPushOpenType", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.personalPushOpenType(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 检测消息推荐开关
|
||||
*/
|
||||
checkPushSwitchStatus: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callBack = fn;
|
||||
device.is_ios && device.addEvent("checkPushSwitchStatus", JSON.stringify(option));
|
||||
device.is_android && GetInfoJs.checkPushSwitchStatus(JSON.stringify(option))
|
||||
},
|
||||
|
||||
showTPwdKeyboard: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.callback = fn;
|
||||
option.len = "6";
|
||||
option.type ="LPWD";
|
||||
device.is_ios && device.addEvent("10", JSON.stringify(option));
|
||||
device.is_android && KeyboardJs.showTPwdKeyboard(JSON.stringify(option))
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 新授权
|
||||
*/
|
||||
getNewAuthorization: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
var option = {};
|
||||
option.fn = fn;
|
||||
device.is_ios && device.addEvent("getNewAuthorization", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.getNewAuthorization(JSON.stringify(fn));
|
||||
// device.is_android && GetInfoJs.getNewAuthorization(JSON.stringify(option));
|
||||
},
|
||||
|
||||
/**
|
||||
* @brief 新授权
|
||||
*/
|
||||
downloadPDF: function (fn) {
|
||||
if (!device.is_ios && !device.is_android) {
|
||||
alert("请在ios/android设备上使用!");
|
||||
return;
|
||||
}
|
||||
device.is_ios && device.addEvent("downloadPDF", JSON.stringify(fn));
|
||||
device.is_android && GetInfoJs.downloadPDF(JSON.stringify(fn))
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
();
|
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 243 B |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 268 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 91 KiB |
|
@ -0,0 +1,24 @@
|
|||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// Generated by vite-plugin-uni-pages
|
||||
|
||||
interface NavigateToOptions {
|
||||
url: "/pages/ycnc/index" |
|
||||
"/pages/ycnc/detail" |
|
||||
"/pages/ycnc/order";
|
||||
}
|
||||
interface RedirectToOptions extends NavigateToOptions {}
|
||||
|
||||
interface SwitchTabOptions {
|
||||
|
||||
}
|
||||
|
||||
type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;
|
||||
|
||||
declare interface Uni {
|
||||
navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
|
||||
redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
|
||||
switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
|
||||
reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
import { defineConfig } from 'unocss'
|
||||
|
||||
export default defineConfig({
|
||||
// ...UnoCSS options
|
||||
})
|
|
@ -0,0 +1,22 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import uni from '@dcloudio/vite-plugin-uni'
|
||||
import UniPages from '@uni-helper/vite-plugin-uni-pages'
|
||||
import UnoCSS from 'unocss/vite'
|
||||
// https://vitejs.dev/config/
|
||||
|
||||
import getPages from './build'
|
||||
const exclude = getPages()
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
UniPages({
|
||||
exclude: ['**/components/**/**.*',...exclude],
|
||||
routeBlockLang: 'json5', // 虽然设了默认值,但是vue文件还是要加上 lang="json5", 这样才能很好地格式化
|
||||
// homePage 通过 vue 文件的 route-block 的type="home"来设定
|
||||
// pages 目录为 src/pages,分包目录不能配置在pages目录下
|
||||
// subPackages: ['src/pages-sub'], // 是个数组,可以配置多个,但是不能为pages里面的目录
|
||||
}),
|
||||
uni(),
|
||||
UnoCSS(),
|
||||
],
|
||||
})
|