From e942e8634b32a1e11fc5a0fd4911b2119701ea13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Thu, 16 Dec 2021 10:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=9A=E4=BC=9Ah5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 4 +- common/jweixin.js | 139 ++++++++++ components/wm-poster/wm-posters.vue | 2 +- main.js | 3 + manifest.json | 20 +- mixins/SendVerifyCode.js | 27 ++ node_modules/jweixin-module/README.md | 30 +++ node_modules/jweixin-module/lib/index.js | 1 + node_modules/jweixin-module/package.json | 54 ++++ node_modules/vue-jsonp/LICENSE | 21 ++ node_modules/vue-jsonp/README.md | 153 +++++++++++ node_modules/vue-jsonp/dist/index.d.ts | 73 ++++++ node_modules/vue-jsonp/dist/index.esm.js | 8 + node_modules/vue-jsonp/dist/index.js | 8 + node_modules/vue-jsonp/dist/utils/index.d.ts | 20 ++ node_modules/vue-jsonp/package.json | 80 ++++++ package-lock.json | 15 +- pages.json | 5 +- pages/index/index.vue | 109 ++++++-- pages/index/selectCampus.vue | 10 +- pages/index/taskDetail.vue | 5 + pages/index/tuijianList.vue | 5 + pages/my/channelshop.vue | 5 + pages/my/index.vue | 17 +- pages/my/myVIP.vue | 67 +++-- pages/my/mychannel.vue | 5 + pages/my/shareFriends.vue | 5 + pages/my/teamList.vue | 5 + pages/order/index.vue | 10 +- pages/public/login.vue | 253 +++++++++++++++---- pages/task/search.vue | 5 + pages/task/tasklist.vue | 5 + static/img/code-icon.png | Bin 0 -> 826 bytes static/img/phone-icon.png | Bin 0 -> 324 bytes 34 files changed, 1046 insertions(+), 123 deletions(-) create mode 100644 common/jweixin.js create mode 100644 mixins/SendVerifyCode.js create mode 100644 node_modules/jweixin-module/README.md create mode 100644 node_modules/jweixin-module/lib/index.js create mode 100644 node_modules/jweixin-module/package.json create mode 100644 node_modules/vue-jsonp/LICENSE create mode 100644 node_modules/vue-jsonp/README.md create mode 100644 node_modules/vue-jsonp/dist/index.d.ts create mode 100644 node_modules/vue-jsonp/dist/index.esm.js create mode 100644 node_modules/vue-jsonp/dist/index.js create mode 100644 node_modules/vue-jsonp/dist/utils/index.d.ts create mode 100644 node_modules/vue-jsonp/package.json create mode 100644 static/img/code-icon.png create mode 100644 static/img/phone-icon.png diff --git a/common/config.js b/common/config.js index 9a9b6be..abd7d86 100644 --- a/common/config.js +++ b/common/config.js @@ -1,4 +1,6 @@ -const ROOTPATH1 = "https://bwc.xianmxkj.com/sqx_fast"; +// const ROOTPATH1 = "http://10.11.32.109:8891/sqx_fast"; +const ROOTPATH1 = "http://10.11.32.107:8891/sqx_fast"; +// const ROOTPATH1 = "http://waimai.n.gznl.top/sqx_fast"; const ROOTPATH = "https://bwc.xianmxkj.com/sqx_fast"; module.exports = { APIHOST: ROOTPATH, diff --git a/common/jweixin.js b/common/jweixin.js new file mode 100644 index 0000000..186964e --- /dev/null +++ b/common/jweixin.js @@ -0,0 +1,139 @@ +var jweixin = require('jweixin-module') +const userId = uni.getStorageSync('userId'); +console.log(userId,'userId') +import HttpRequest from '../common/httpRequest' +export default { + //判断是否在微信中 + isWechat: function () { + var ua = window.navigator.userAgent.toLowerCase(); + if (ua.match(/micromessenger/i) == 'micromessenger') { + // console.log(‘是微信客户端‘) + return true; + } else { + // console.log(‘不是微信客户端‘) + return false; + } + }, + //初始化sdk配置 + initJssdkShare: function (callback, url) { + HttpRequest.getT('/appLogin/jsapiInit',{url: url}).then((result)=>{ + if(result.code == 0){ + jweixin.config({ + debug: false, + appId: result.appId, + timestamp: result.timestamp, + nonceStr: result.nonceStr, + signature: result.signature, + jsApiList: [ + 'chooseWXPay', + 'checkJsApi', + 'updateTimelineShareData', + 'updateAppMessageShareData', + 'getLocation' + ] + }); + if (callback) { + callback(result); + } + } + }) + }, + share: function (data, url) { + url = url ? url : window.location.href; + console.log("url:" + url) + if (!this.isWechat()) { + uni.showToast({ + title: '不在微信客户端', + icon: 'none' + }) + return; + } + //每次都需要重新初始化配置,才可以进行分享 + this.initJssdkShare(function (signData) { + jweixin.ready(function () { + var shareData = { + title: data && data.title ? data.title : signData.site_name, + desc: data && data.desc ? data.desc : signData.site_description, + link: url, + imgUrl: data && data.img ? data.img : signData.site_logo, + success: function (res) { + // 分享后的一些操作,比如分享统计等等 + }, + cancel: function (res) {} + }; + //分享给朋友接口 + jweixin.updateAppMessageShareData(shareData); + //分享到朋友圈接口 + // jweixin.updateTimelineShareData(shareData); + }); + }, url) + }, + wxChatWebPay: function (url) { + if (!this.isWechat()) { + uni.showToast({ + title: '不在微信客户端', + icon: 'none' + }) + return; + } + return new Promise((resolve,reject)=>{ + //每次都需要重新初始化配置 + this.initJssdkShare(function () { + jweixin.ready(function () { + HttpRequest.postT('/api/order/wxPayMember?userId=' + userId + '&type=3').then((orderInfo)=>{ + jweixin.chooseWXPay({ + nonceStr: orderInfo.noncestr, + timestamp: orderInfo.timestamp, + package: orderInfo.package, + signType: orderInfo.signType, + paySign: orderInfo.sign, + success: (res) => { + console.log('支付成功') + resolve(res) + }, + fail: (res)=> { + reject(res) + console.log('支付失败') + }, + cancel: (res)=> { + resolve(res) + console.log('取消支付') + } + }) + }) + + }); + },url) + }) + }, + wxGetLocation: function(url){ + return new Promise((resolve,reject)=>{ + if (!this.isWechat()) { + uni.showModal({ + title: '提示!', + content: '请在微信客户端内打开', + showCancel: false + }) + uni.hideLoading() + return + reject(res) + } + //每次都需要重新初始化配置 + this.initJssdkShare(function () { + jweixin.ready(function () { + jweixin.getLocation({ + type: 'wgs84', + success: function (res) { + console.log('jssdk获取的位置:',res.longitude,res.latitude) + resolve(res) + }, + cancel: function (res) { + reject(res) + alert('您已禁止获取位置信息') + } + }); + }); + },url) + }) + } +} diff --git a/components/wm-poster/wm-posters.vue b/components/wm-poster/wm-posters.vue index 7506246..1cfdd4f 100644 --- a/components/wm-poster/wm-posters.vue +++ b/components/wm-poster/wm-posters.vue @@ -24,7 +24,7 @@ }, Title: { //文本内容 Type: String, - default: '省钱兄霸王餐' + default: '惠聚' }, TitleColor: { //标题颜色 Type: String, diff --git a/main.js b/main.js index d6a61f5..a232aa8 100644 --- a/main.js +++ b/main.js @@ -32,6 +32,9 @@ Vue.prototype.$SysCache = HttpCache; Vue.mixin(share) App.mpType = 'app'; +import {VueJsonp} from 'vue-jsonp' +Vue.use(VueJsonp) + const app = new Vue({ ...App diff --git a/manifest.json b/manifest.json index e7a0a72..589de20 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "省钱兄霸王餐", + "name" : "惠聚", "appid" : "__UNI__uni_sqx", "description" : "", "versionName" : "1.0.6", @@ -165,7 +165,21 @@ "enable" : false }, "h5" : { - "title" : "省钱兄霸王餐", - "domain" : "https://bwc.xianmxkj.com" + "title" : "惠聚", + "domain" : "https://bwc.xianmxkj.com", + "router" : { + "mode" : "history" + }, + "devServer" : { + "https" : false, + "disableHostCheck" : true + }, + "sdkConfigs" : { + "maps" : { + "qqmap" : { + "key" : "LH3BZ-NYN62-2SIUW-CGKY5-K5MXT-FWFOI" + } + } + } } } diff --git a/mixins/SendVerifyCode.js b/mixins/SendVerifyCode.js new file mode 100644 index 0000000..d2133b0 --- /dev/null +++ b/mixins/SendVerifyCode.js @@ -0,0 +1,27 @@ +export default { + data() { + return { + disabled: false, + text: "获取验证码" + }; + }, + methods: { + sendCode() { + if (this.disabled) return; + this.disabled = true; + let n = 60; + this.text = "剩余 " + n + "s"; + const run = setInterval(() => { + n = n - 1; + if (n < 0) { + clearInterval(run); + } + this.text = "剩余 " + n + "s"; + if (this.text < "剩余 " + 0 + "s") { + this.disabled = false; + this.text = "重新获取"; + } + }, 1000); + } + } +}; diff --git a/node_modules/jweixin-module/README.md b/node_modules/jweixin-module/README.md new file mode 100644 index 0000000..7c91d7b --- /dev/null +++ b/node_modules/jweixin-module/README.md @@ -0,0 +1,30 @@ +# jweixin-module + +微信JS-SDK + +## 安装 + +### NPM + +```shell +npm install jweixin-module --save +``` + +### UMD + +```http +https://unpkg.com/jweixin-module/out/index.js +``` + +## 使用 + +```js +var jweixin = require('jweixin-module') +jweixin.ready(function(){ + // TODO +}); +``` + +## 完整API + +>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115) diff --git a/node_modules/jweixin-module/lib/index.js b/node_modules/jweixin-module/lib/index.js new file mode 100644 index 0000000..1b5014b --- /dev/null +++ b/node_modules/jweixin-module/lib/index.js @@ -0,0 +1 @@ +!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n` + + - `jsonp: (url: string, param?: IJsonpParam, timeout?: number) => Promise` + +## API + +### IJsonpParam + +IJsonpParam is the type of param for jsonp function. + +```ts +/** + * JSONP parameter declaration. + */ +interface IJsonpParam { + /** + * Callback query name. + * This param is used to define the query name of the callback function. + * + * @example + * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" + * jsonp('/some-url', { + * callbackQuery: 'myCallback', + * callbackName: 'jsonp_func', + * myCustomUrlParam: 'veryNice' + * }) + * + * @default callback + */ + callbackQuery?: string + + /** + * Callback function name. + * This param is used to define the jsonp function name. + * + * @example + * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" + * jsonp('/some-url', { + * callbackQuery: 'myCallback', + * callbackName: 'jsonp_func', + * myCustomUrlParam: 'veryNice' + * }) + * + * @default jsonp_ + randomStr() + */ + callbackName?: string + + /** + * Custom data. + */ + [key: string]: any +} +``` + +## Example + +```ts +import Vue from 'vue' +import { VueJsonp } from 'vue-jsonp' + +Vue.use(VueJsonp) + +const vm = new Vue() +const { code, data, message } = await vm.$jsonp<{ + code: number, + message: string, + data: { + id: number, + nickname: string + } +}>('/my-awesome-url', { + name: 'MyName', age: 20 +}) + +assert(code === 0) +assert(message === 'ok') +assert(data.id === 1) +assert(data.nickname === 'John Smith') +``` + +```ts +import { jsonp } from 'vue-jsonp' + +const result = await jsonp('/my-awesome-url') +assert(result === 'such a jsonp') +``` + +## License + +MIT diff --git a/node_modules/vue-jsonp/dist/index.d.ts b/node_modules/vue-jsonp/dist/index.d.ts new file mode 100644 index 0000000..ec621c7 --- /dev/null +++ b/node_modules/vue-jsonp/dist/index.d.ts @@ -0,0 +1,73 @@ +/** + * Vue Jsonp. + * # Carry Your World # + * + * @author: LancerComet + * @license: MIT + */ +import { PluginObject } from 'vue/types/plugin'; +declare module 'vue/types/vue' { + interface Vue { + $jsonp: typeof jsonp; + } +} +/** + * Vue JSONP. + */ +declare const VueJsonp: PluginObject; +/** + * JSONP function. + * + * @param { string } url Target URL address. + * @param { IJsonpParam } param Querying params object. + * @param { number } timeout Timeout setting (ms). + * + * @example + * jsonp('/url', { + * callbackQuery: '' + * callbackName: '', + * name: 'LancerComet', + * age: 26 + * }, 1000) + */ +declare function jsonp(url: string, param?: IJsonpParam, timeout?: number): Promise; +export { VueJsonp, jsonp }; +/** + * JSONP parameter declaration. + */ +interface IJsonpParam { + /** + * Callback query name. + * This param is used to define the query name of the callback function. + * + * @example + * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" + * jsonp('/some-url', { + * callbackQuery: 'myCallback', + * callbackName: 'jsonp_func', + * myCustomUrlParam: 'veryNice' + * }) + * + * @default callback + */ + callbackQuery?: string; + /** + * Callback function name. + * This param is used to define the jsonp function name. + * + * @example + * // The request url will be "/some-url?myCallback=jsonp_func&myCustomUrlParam=veryNice" + * jsonp('/some-url', { + * callbackQuery: 'myCallback', + * callbackName: 'jsonp_func', + * myCustomUrlParam: 'veryNice' + * }) + * + * @default jsonp_ + randomStr() + */ + callbackName?: string; + /** + * Custom data. + */ + [key: string]: any; +} diff --git a/node_modules/vue-jsonp/dist/index.esm.js b/node_modules/vue-jsonp/dist/index.esm.js new file mode 100644 index 0000000..893bec4 --- /dev/null +++ b/node_modules/vue-jsonp/dist/index.esm.js @@ -0,0 +1,8 @@ +function e(t,n){t=t.replace(/=/g,"");var o=[];switch(n.constructor){case String:case Number:case Boolean:o.push(encodeURIComponent(t)+"="+encodeURIComponent(n));break;case Array:n.forEach((function(n){o=o.concat(e(t+"[]=",n))}));break;case Object:Object.keys(n).forEach((function(r){var a=n[r];o=o.concat(e(t+"["+r+"]",a))}))}return o}function t(e){var n=[];return e.forEach((function(e){"string"==typeof e?n.push(e):n=n.concat(t(e))})),n} +/** + * Vue Jsonp. + * # Carry Your World # + * + * @author: LancerComet + * @license: MIT + */var n={install:function(e){e.prototype.$jsonp=o}};function o(n,o,r){if(void 0===o&&(o={}),"string"!=typeof n)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof o||!o)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(a,c){var u="string"==typeof o.callbackQuery?o.callbackQuery:"callback",i="string"==typeof o.callbackName?o.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);o[u]=i,delete o.callbackQuery,delete o.callbackName;var s=[];Object.keys(o).forEach((function(t){s=s.concat(e(t,o[t]))}));var l=t(s).join("&"),f=function(){p(),clearTimeout(m),c({status:400,statusText:"Bad Request"})},p=function(){b.removeEventListener("error",f)},d=function(){document.body.removeChild(b),delete window[i]},m=null;r>-1&&(m=setTimeout((function(){p(),d(),c({statusText:"Request Timeout",status:408})}),r)),window[i]=function(e){clearTimeout(m),p(),d(),a(e)};var b=document.createElement("script");b.addEventListener("error",f),b.src=n+(/\?/.test(n)?"&":"?")+l,document.body.appendChild(b)}))}export{n as VueJsonp,o as jsonp}; diff --git a/node_modules/vue-jsonp/dist/index.js b/node_modules/vue-jsonp/dist/index.js new file mode 100644 index 0000000..c5e0aee --- /dev/null +++ b/node_modules/vue-jsonp/dist/index.js @@ -0,0 +1,8 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueJsonp={})}(this,(function(e){"use strict";function t(e,o){e=e.replace(/=/g,"");var n=[];switch(o.constructor){case String:case Number:case Boolean:n.push(encodeURIComponent(e)+"="+encodeURIComponent(o));break;case Array:o.forEach((function(o){n=n.concat(t(e+"[]=",o))}));break;case Object:Object.keys(o).forEach((function(r){var c=o[r];n=n.concat(t(e+"["+r+"]",c))}))}return n}function o(e){var t=[];return e.forEach((function(e){"string"==typeof e?t.push(e):t=t.concat(o(e))})),t} +/** + * Vue Jsonp. + * # Carry Your World # + * + * @author: LancerComet + * @license: MIT + */var n={install:function(e){e.prototype.$jsonp=r}};function r(e,n,r){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error('[Vue-jsonp] Type of param "url" is not string.');if("object"!=typeof n||!n)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return r="number"==typeof r?r:5e3,new Promise((function(c,a){var i="string"==typeof n.callbackQuery?n.callbackQuery:"callback",s="string"==typeof n.callbackName?n.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);n[i]=s,delete n.callbackQuery,delete n.callbackName;var u=[];Object.keys(n).forEach((function(e){u=u.concat(t(e,n[e]))}));var f=o(u).join("&"),l=function(){p(),clearTimeout(b),a({status:400,statusText:"Bad Request"})},p=function(){m.removeEventListener("error",l)},d=function(){document.body.removeChild(m),delete window[s]},b=null;r>-1&&(b=setTimeout((function(){p(),d(),a({statusText:"Request Timeout",status:408})}),r)),window[s]=function(e){clearTimeout(b),p(),d(),c(e)};var m=document.createElement("script");m.addEventListener("error",l),m.src=e+(/\?/.test(e)?"&":"?")+f,document.body.appendChild(m)}))}e.VueJsonp=n,e.jsonp=r,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/node_modules/vue-jsonp/dist/utils/index.d.ts b/node_modules/vue-jsonp/dist/utils/index.d.ts new file mode 100644 index 0000000..6b2f521 --- /dev/null +++ b/node_modules/vue-jsonp/dist/utils/index.d.ts @@ -0,0 +1,20 @@ +/** + * Generate random string. + * + * @return { string } + */ +declare function randomStr(): string; +/** + * Format params into querying string. + * + * @return {string[]} + */ +declare function formatParams(queryKey: string, value: any): string[]; +/** + * Flat querys. + * + * @param {string[] | (string[])[]} array + * @returns + */ +declare function flatten(array: string[] | (string[])[]): string[]; +export { formatParams, flatten, randomStr }; diff --git a/node_modules/vue-jsonp/package.json b/node_modules/vue-jsonp/package.json new file mode 100644 index 0000000..c1eb451 --- /dev/null +++ b/node_modules/vue-jsonp/package.json @@ -0,0 +1,80 @@ +{ + "_from": "vue-jsonp", + "_id": "vue-jsonp@2.0.0", + "_inBundle": false, + "_integrity": "sha1-O/rFa7cpQaJRHBHhoSO4dvA0J/c=", + "_location": "/vue-jsonp", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "vue-jsonp", + "name": "vue-jsonp", + "escapedName": "vue-jsonp", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.nlark.com/vue-jsonp/download/vue-jsonp-2.0.0.tgz", + "_shasum": "3bfac56bb72941a2511c11e1a123b876f03427f7", + "_spec": "vue-jsonp", + "_where": "F:\\惠聚h5\\huiju-user", + "author": { + "name": "LancerComet", + "email": "chw644@hotmail.com" + }, + "bugs": { + "url": "https://github.com/LancerComet/vue-jsonp/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A tiny library for handling JSONP request.", + "devDependencies": { + "@types/expect-puppeteer": "^4.4.3", + "@types/jest": "^26.0.14", + "@types/jest-environment-puppeteer": "^4.4.0", + "@types/puppeteer": "^3.0.2", + "jest": "^26.4.2", + "jest-puppeteer": "^4.4.0", + "puppeteer": "^5.3.1", + "rollup": "^2.28.2", + "rollup-plugin-cleanup": "^3.2.1", + "rollup-plugin-delete": "^2.0.0", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-typescript2": "^0.27.3", + "ts-jest": "^26.4.1", + "tslint": "^6.1.3", + "typescript": "^4.0.3", + "vue": "^2.6.12" + }, + "files": [ + "dist/", + "index.d.ts", + "README.md" + ], + "homepage": "https://github.com/LancerComet/vue-jsonp#readme", + "keywords": [ + "Vue", + "JSONP" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist/index.esm.js", + "name": "vue-jsonp", + "repository": { + "type": "git", + "url": "git+https://github.com/LancerComet/vue-jsonp.git" + }, + "scripts": { + "build": "rollup -c", + "prepublish": "npm run test", + "pretest": "npm run build", + "preversion": "npm run test", + "test": "jest" + }, + "version": "2.0.0" +} diff --git a/package-lock.json b/package-lock.json index 48e341a..8f3d08f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,3 +1,16 @@ { - "lockfileVersion": 1 + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "jweixin-module": { + "version": "1.6.0", + "resolved": "https://registry.nlark.com/jweixin-module/download/jweixin-module-1.6.0.tgz", + "integrity": "sha1-Sn6mFAg+PJw/SeL9wruILPpY380=" + }, + "vue-jsonp": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/vue-jsonp/download/vue-jsonp-2.0.0.tgz", + "integrity": "sha1-O/rFa7cpQaJRHBHhoSO4dvA0J/c=" + } + } } diff --git a/pages.json b/pages.json index d12afeb..efbade9 100644 --- a/pages.json +++ b/pages.json @@ -424,8 +424,11 @@ } ], "globalStyle": { + // #ifdef H5 + "navigationStyle": "custom", + // #endif "navigationBarTextStyle": "black", - "navigationBarTitleText": "省钱兄霸王餐", + "navigationBarTitleText": "惠聚", "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF" }, diff --git a/pages/index/index.vue b/pages/index/index.vue index a6dd92d..2df0d39 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,7 +4,7 @@ - {{ localCampus }} + {{ city }} @@ -72,6 +72,7 @@ diff --git a/pages/my/mychannel.vue b/pages/my/mychannel.vue index 9ab20ef..4f7d7d1 100644 --- a/pages/my/mychannel.vue +++ b/pages/my/mychannel.vue @@ -42,9 +42,14 @@ } }, goLogin() { + //#ifndef H5 uni.navigateTo({ url: '/pages/public/login' }); + //#endif + //#ifdef H5 + window.location.href = 'http://waimai.n.gznl.top/sqx_fast/appLogin/wechatLogin'; + //#endif } } } diff --git a/pages/my/shareFriends.vue b/pages/my/shareFriends.vue index b8037d5..15d8272 100644 --- a/pages/my/shareFriends.vue +++ b/pages/my/shareFriends.vue @@ -173,9 +173,14 @@ this.modalName = 'Image'; }, goLogin() { + //#ifndef H5 uni.navigateTo({ url: '/pages/public/login' }); + //#endif + //#ifdef H5 + window.location.href = 'http://waimai.n.gznl.top/sqx_fast/appLogin/wechatLogin'; + //#endif }, showModal() { let token = this.$queue.getData('token'); diff --git a/pages/my/teamList.vue b/pages/my/teamList.vue index d861afe..77107c6 100644 --- a/pages/my/teamList.vue +++ b/pages/my/teamList.vue @@ -49,9 +49,14 @@ } }, goLogin() { + //#ifndef H5 uni.navigateTo({ url: '/pages/public/login' }); + //#endif + //#ifdef H5 + window.location.href = 'http://waimai.n.gznl.top/sqx_fast/appLogin/wechatLogin'; + //#endif } } } diff --git a/pages/order/index.vue b/pages/order/index.vue index cbf4e18..c9adadd 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -117,7 +117,7 @@ this.page = 1; this.getList(); } else { - this.goLogin(); + // this.goLogin(); } }, methods: { @@ -203,9 +203,14 @@ this.getList(); }, goLogin() { + //#ifndef H5 uni.navigateTo({ url: '/pages/public/login' }); + //#endif + //#ifdef H5 + window.location.href = 'http://waimai.n.gznl.top/sqx_fast/appLogin/wechatLogin'; + //#endif }, goDetail(id) { var latitude = this.$queue.getData('latitude') @@ -357,7 +362,6 @@ .main { padding: 106upx 20upx 0; - .card-box-order { .list-item { background: #FFFFFF; @@ -756,7 +760,7 @@ /* #endif */ /* #ifdef H5 */ position: fixed; - top: 44px; + top: 0px; left: 0; z-index: 999; /* #endif */ diff --git a/pages/public/login.vue b/pages/public/login.vue index 15014df..218b0dc 100644 --- a/pages/public/login.vue +++ b/pages/public/login.vue @@ -5,11 +5,14 @@ - + - 申请获取以下权限 - 获得你的公开信息(昵称,头像、地区等) + 惠聚买单 + + 为了提供优质服务,需要您授权基本信息 --> - + - - 同意 + 我已阅读并同意 - 《隐私政策》和 - 《用户服务协议》 - - + 《隐私政策》和 + 《用户服务协议》 + + + + + + + + + + + + + + + + {{ text }} + + + 立即登录 + + + + 我已阅读并同意 + + + 《隐私政策》和 + 《用户服务协议》 + + + - -