Commit a875c80b authored by wangwei's avatar wangwei

打包

parent 45495184
...@@ -7,6 +7,6 @@ module.exports = merge(prodEnv, { ...@@ -7,6 +7,6 @@ module.exports = merge(prodEnv, {
API_URL: '"/"', API_URL: '"/"',
MAX_FILESIZE:'1024*1024*10', MAX_FILESIZE:'1024*1024*10',
IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"', IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"',
AUTHOR_UEL:'"https://wechat_test.changchangenglish.com/api/client/login"', AUTHOR_UEL:'"http://wechat.test.singsingenglish.com/api/client/login?redirect_url=http://10.1.21.181:8085"',
REDIRECT_URL:'"http://localhost:8085/"', REDIRECT_URL:'"http://localhost:8085/"',
}); });
...@@ -18,7 +18,7 @@ module.exports = { ...@@ -18,7 +18,7 @@ module.exports = {
} }
}, },
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST host: '10.1.21.181', // can be overwritten by process.env.HOST
port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
......
...@@ -4,5 +4,5 @@ module.exports = { ...@@ -4,5 +4,5 @@ module.exports = {
IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"', IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"',
API_URL: '"/"', API_URL: '"/"',
MAX_FILESIZE:'1024*1024*10', MAX_FILESIZE:'1024*1024*10',
AUTHOR_UEL:'"https://wechat_test.changchangenglish.com/api/client/login"' AUTHOR_UEL:'"http://wechat.test.singsingenglish.com/api/client/login"'
} }
...@@ -7,5 +7,5 @@ module.exports = merge(prodEnv, { ...@@ -7,5 +7,5 @@ module.exports = merge(prodEnv, {
IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"', IMAGE_URL_HEAD:'"http://cdn.singsingenglish.com/"',
API_URL: '"/"', API_URL: '"/"',
MAX_FILESIZE:'1024*1024*10', MAX_FILESIZE:'1024*1024*10',
AUTHOR_UEL:'"https://wechat_test.changchangenglish.com/api/client/login"' AUTHOR_UEL:'"http://wechat.test.singsingenglish.com/api/client/login"'
}) })
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title>唱唱启蒙英语</title><link rel=stylesheet href=https://at.alicdn.com/t/font_822651_udxjxcaax8f.css><link href=/static/css/app.73c2e3a47f23cb672459f1ae0dda6041.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.2440c0f987f7b21e5d78.js></script><script type=text/javascript src=/static/js/app.0fcb52d6e3a842310d01.js></script></body></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"><title>唱唱启蒙英语</title><link rel=stylesheet href=https://at.alicdn.com/t/font_822651_udxjxcaax8f.css><link href=/static/css/app.26b9daa948bdc83eb680b0332169ab2d.css rel=stylesheet></head><body><div id=app></div><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js></script><script src=static/vconsole/vconsole.min.js></script><script>var vConsole = new VConsole();</script><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.a36caa6cd5af266e2b79.js></script><script type=text/javascript src=/static/js/app.6af81cc7a7685ff5f60b.js></script></body></html>
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"version":3,"sources":["webpack:///webpack/bootstrap 209319a74e7eacc10cfc"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 209319a74e7eacc10cfc"],"sourceRoot":""} {"version":3,"sources":["webpack:///webpack/bootstrap e63c968556b3abbbd15f"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e63c968556b3abbbd15f"],"sourceRoot":""}
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -9,5 +9,10 @@ ...@@ -9,5 +9,10 @@
<body> <body>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="static/vconsole/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
</script>
</body> </body>
</html> </html>
...@@ -15,7 +15,8 @@ export default { ...@@ -15,7 +15,8 @@ export default {
} }
}, },
created () { created () {
window.location.href = `${process.env.AUTHOR_UEL}?redirect_url=${this.$route.query.retUrl}` localStorage.setItem('retUrl',this.$route.query.retUrl);
window.location.href = `${process.env.AUTHOR_UEL}`
}, },
methods: { methods: {
onPageReload: function () { onPageReload: function () {
......
<template> <template>
<div class="group-buy"> <div class="group-buy">
<div class="address-block" v-if="groupDetail.allow_distribute === 1"> <div class="address-block">
<div class="add-address" v-if="!addressObj" @click="showAdd"> <div class="add-address" v-if="!addressObj" @click="showAdd">
+请输入收件人地址 +请输入收件人地址
</div> </div>
...@@ -13,20 +13,16 @@ ...@@ -13,20 +13,16 @@
<div class="shop-block"> <div class="shop-block">
<div class="shop"> <div class="shop">
<div class="img-block"> <div class="img-block">
<img :src="groupDetail.share_info.shareIcon">
</div> </div>
<div> <div>
<div class="title"> <div class="title">
{{groupDetail.product_title}} {{groupDetail.name}}
</div> </div>
<div class="content"> <div class="content">
{{groupDetail.product_detail}} {{groupDetail.goods_desc}}
</div> </div>
<div class="price" v-if="type === 0"> <div class="price" v-if="type === 0">
价格 ¥{{groupDetail.single_price/100}} 价格 ¥{{groupDetail.original_price/100}}
</div>
<div class="price" v-if="type === 1">
团购价 ¥{{groupDetail.group_price/100}}
</div> </div>
</div> </div>
</div> </div>
...@@ -44,9 +40,8 @@ ...@@ -44,9 +40,8 @@
</template> </template>
<script> <script>
import Service from '../../service'
import common from '../../util/common'
import { Toast, MessageBox } from 'mint-ui' import { Toast, MessageBox } from 'mint-ui'
import {getUserAdressApi,getGoodsDetailApi,payApi,getwechatParam} from "../../service/api";
import addAddress from './address' import addAddress from './address'
export default { export default {
name: "buy", name: "buy",
...@@ -102,7 +97,7 @@ ...@@ -102,7 +97,7 @@
// window.location.href = `/#/groupSuccess?out_trade_no=${that.orderNo}` // window.location.href = `/#/groupSuccess?out_trade_no=${that.orderNo}`
} }
if (res.err_msg === 'get_brand_wcpay_request:fail') { if (res.err_msg === 'get_brand_wcpay_request:fail') {
Toast('购买失败') Toast(res.err_msg)
} }
if (res.err_msg === 'get_brand_wcpay_request:cancel') { if (res.err_msg === 'get_brand_wcpay_request:cancel') {
Toast('取消购买') Toast('取消购买')
...@@ -110,23 +105,17 @@ ...@@ -110,23 +105,17 @@
}) })
}, },
payOrder(){ payOrder(){
if(this.groupDetail.allow_distribute === 1 && !this.addressObj){ if(this.groupDetail.allow_distribute === 1 && !this.addressObj){
Toast('请填写地址'); Toast('请填写地址');
return false return false
} }
let json={ let json={
product_type:'group', goods_id:this.shopId
buy_type:this.type,
source:this.source,
group_order_id:this.groupId,
product_id:this.shopId
}; };
Service.groupPay(json).then(res=>{ payApi(json).then(res=>{
if (res.data.result === 'success') {
let that = this; let that = this;
this.orderNo = res.data.data.out_trade_no this.orderNo = res.out_trade_no
this.jsApiParameters = res.data.data; this.jsApiParameters = res;
wx.miniProgram.getEnv(function(res) { wx.miniProgram.getEnv(function(res) {
if(res.miniprogram){ if(res.miniprogram){
let payParam = encodeURIComponent(JSON.stringify(json)) let payParam = encodeURIComponent(JSON.stringify(json))
...@@ -134,6 +123,7 @@ ...@@ -134,6 +123,7 @@
window._hmt.push(['_trackEvent', 'document','miniPay','触发小程序购买']); window._hmt.push(['_trackEvent', 'document','miniPay','触发小程序购买']);
wx.miniProgram.navigateTo({url: `pages/wxPay/main?payParam=${payParam}`}) wx.miniProgram.navigateTo({url: `pages/wxPay/main?payParam=${payParam}`})
}else if (typeof WeixinJSBridge === 'undefined') { }else if (typeof WeixinJSBridge === 'undefined') {
alert(2)
if (document.addEventListener) { if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', that.jsApiCall, false) document.addEventListener('WeixinJSBridgeReady', that.jsApiCall, false)
} else if (document.attachEvent) { } else if (document.attachEvent) {
...@@ -144,11 +134,6 @@ ...@@ -144,11 +134,6 @@
that.jsApiCall() that.jsApiCall()
} }
}) })
} else {
MessageBox.alert('', res.data.message)
}
}) })
}, },
closeAdd(data){ closeAdd(data){
...@@ -159,32 +144,31 @@ ...@@ -159,32 +144,31 @@
this.addressPop = true this.addressPop = true
}, },
initPage(){ initPage(){
Service.getUserAddress().then(res=>{ getwechatParam({api_list:'chooseWXPay'}).then(res=>{
this.addressObj = res.data.data console.log(res)
wx.config({
debug: res.debug,
appId: res.appId,
timestamp: parseInt(res.timestamp),
nonceStr: res.nonceStr,
signature: res.signature,
jsApiList: ["chooseImage","previewImage","uploadImage","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","onMenuShareTimeline","onMenuShareAppMessage"]
}); });
});
this.type = Number(common.getUrlParam('type')); getUserAdressApi().then(res=>{
this.shopId = common.getUrlParam('shopId'); this.addressObj = res
Service.getGroupDetail(this.shopId).then(res=>{ });
if(res.data.result==='success'){ this.shopId = this.$route.query.shopId;
let data = res.data.data; getGoodsDetailApi(this.shopId).then(data=>{
data.product_img = JSON.parse(data.product_img);
data.share_info = JSON.parse(data.share_info);
this.groupDetail = data; this.groupDetail = data;
this.groupId = common.getUrlParam('groupId'); this.source = this.$route.query.source;
this.source = common.getUrlParam('source');
this.trackingPage(`shopId=${this.shopId}&groupId=${this.groupId}&source=${this.source}&type=${this.type}`,'page');
if(this.type === 0){ if(this.type === 0){
this.price=data.single_price/100 this.price=data.single_price/100
}else{ }else{
this.price = data.group_price/100 this.price = data.group_price/100
} }
}else{
Toast(res.data.message);
}
}); });
this.jsApiCall()
} }
} }
...@@ -206,26 +190,26 @@ ...@@ -206,26 +190,26 @@
.group-buy{ .group-buy{
.address-block{ .address-block{
background: #f0f0f0; background: #f0f0f0;
padding: 10*7.5vw 0; padding: 10/7.5vw 0;
.add-address{ .add-address{
background: white; background: white;
height: 90*7.5vw; height: 90/7.5vw;
line-height: 90*7.5vw; line-height: 90/7.5vw;
margin: 20*7.5vw 20*7.5vw; margin: 20/7.5vw 20/7.5vw;
text-align: center; text-align: center;
border-radius: 100px; border-radius: 100px;
font-size: 16px; font-size: 16px;
color: #666666; color: #666666;
} }
.address-content{ .address-content{
padding: 20*7.5vw; padding: 20/7.5vw;
background: white; background: white;
line-height: 1.6em; line-height: 1.6em;
} }
} }
.shop-block{ .shop-block{
.shop{ .shop{
padding: 20*7.5vw; padding: 20/7.5vw;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
position: relative; position: relative;
&:after{ &:after{
...@@ -235,9 +219,9 @@ ...@@ -235,9 +219,9 @@
} }
.img-block{ .img-block{
float: left; float: left;
margin-right: 20*7.5vw; margin-right: 20/7.5vw;
img{ img{
width: 250*7.5vw; width: 250/7.5vw;
} }
min-height: 120px; min-height: 120px;
} }
...@@ -248,7 +232,7 @@ ...@@ -248,7 +232,7 @@
text-overflow:ellipsis; text-overflow:ellipsis;
white-space: nowrap; white-space: nowrap;
color: #333333; color: #333333;
margin-bottom: 5*7.5vw; margin-bottom: 5/7.5vw;
} }
.content{ .content{
font-size: 12px; font-size: 12px;
...@@ -262,8 +246,8 @@ ...@@ -262,8 +246,8 @@
font-size: 18px; font-size: 18px;
color: #FF001F; color: #FF001F;
position: absolute; position: absolute;
right: 20*7.5vw; right: 20/7.5vw;
bottom: 20*7.5vw; bottom: 20/7.5vw;
} }
} }
} }
...@@ -272,18 +256,18 @@ ...@@ -272,18 +256,18 @@
bottom: 0; bottom: 0;
width: 100%; width: 100%;
border-top: 1px solid #d8d8d8; border-top: 1px solid #d8d8d8;
padding-left: 20*7.5vw; padding-left: 20/7.5vw;
height: 100*7.5vw; height: 100/7.5vw;
line-height: 100*7.5vw; line-height: 100/7.5vw;
span{ span{
font-size: 20px; font-size: 20px;
color: #F83534; color: #F83534;
} }
.pay-btn{ .pay-btn{
width: 300*7.5vw; width: 300/7.5vw;
text-align: center; text-align: center;
float: right; float: right;
height: 100*7.5vw; height: 100/7.5vw;
background: #F83534; background: #F83534;
color: white; color: white;
} }
......
...@@ -119,28 +119,6 @@ ...@@ -119,28 +119,6 @@
}, },
methods:{ methods:{
enableShare: function(option) {
let _url = location.href
getwechatParam().then(wechatRes => {
if (wechatRes.data.result === 'success') {
ShareJs.wxConfig(wechatRes.data.data)
let options = {
title: option.product_title,
desc: option.desc,
link: option.shareUrl,
success:function () {
let link = `shopId=${this.shopId}&groupId=${this.groupId}&source=${this.source}`
window._hmt.push(['_trackEvent', '团购首页', "分享",'商品首页分享',link]);//百度统计
this.trackingPage(link,'share')
}
};
if (option.shareIcon) {
options.imgUrl = option.shareIcon
}
ShareJs.setOptions(options)
}
})
},
onShare: function(type) { onShare: function(type) {
let URL = `${process.env.API_URL2}/#/groupbuy?groupId=${this.groupId}&source=${this.source}`; let URL = `${process.env.API_URL2}/#/groupbuy?groupId=${this.groupId}&source=${this.source}`;
if(type === 1 ){ if(type === 1 ){
...@@ -172,25 +150,13 @@ ...@@ -172,25 +150,13 @@
}, },
groupPay(type){ groupPay(type){
if (Cookie.get('cc_token')) { if (Cookie.get('cc_token')) {
checkGroupPay(this.shopId).then(res => {
if (res.data.result === 'success') {
this.$router.push({ this.$router.push({
name: 'groupBuyPay', name: 'buy',
query: {groupId: this.groupId, shopId: this.shopId, type: type,source:this.source} query: {shopId: this.shopId,source:this.source}
})
} else if(res.data.message === '数据不存在'){
this.popType = true;
this.popupVisible = true;
this.popcontentW = `该商品已下架,<br>您可以添加微信公众号了解更多`
}else{
this.popType = true;
this.popupVisible = true;
this.popcontentW = `您已经购买过课程,无需重复<br>购买,您可以添加微信公众号了解更多`
}
}) })
} else { } else {
this.$router.push({name:'author',query:{'retUrl':window.location.href}}) console.log(this.$route.fullPath)
this.$router.push({name:'author',query:{'retUrl':this.$route.fullPath}})
} }
} }
} }
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
</template> </template>
<script> <script>
import Service from '../../service'
import ShareJs from '@/util/share' import ShareJs from '@/util/share'
import defaultUserIconUrl from '../../assets/Shape@2x.png' import defaultUserIconUrl from '../../assets/Shape@2x.png'
import successIconUrl from '../../assets/successIcon.png' import successIconUrl from '../../assets/successIcon.png'
......
...@@ -4,9 +4,11 @@ import Vue from 'vue' ...@@ -4,9 +4,11 @@ import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import store from './store' import store from './store'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css' import 'mint-ui/lib/style.css'
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(MintUI)
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
......
import Vue from 'vue' import Vue from 'vue'
import store from "@/store"
import Cookie from '../util/cookie'
import common from '../util/common'
import Router from 'vue-router' import Router from 'vue-router'
import index from '@/components/index' import index from '@/components/index'
import buyDetail from '@/components/buy/index' import buyDetail from '@/components/buy/index'
...@@ -21,7 +24,10 @@ const router =new Router({ ...@@ -21,7 +24,10 @@ const router =new Router({
},{ },{
path: '/buyDetail', path: '/buyDetail',
name: 'buyDetail', name: 'buyDetail',
component: buyDetail component: buyDetail,
meta:{
skip_login:true
}
}, { }, {
path: '/buy', path: '/buy',
name: 'buy', name: 'buy',
...@@ -36,7 +42,35 @@ const router =new Router({ ...@@ -36,7 +42,35 @@ const router =new Router({
router.beforeEach((to,from,next)=> { router.beforeEach((to,from,next)=> {
let goOn=function(){
if(localStorage.getItem('retUrl') && localStorage.getItem('retUrl') !== null && localStorage.getItem('retUrl') !== ''){
let retUrl = localStorage.getItem('retUrl');
next(retUrl);
localStorage.removeItem('retUrl');
}else{
next()
}
};
if(to.name === 'author'){
next()
}else if(window.location.href.indexOf('token')>-1){
let token = common.getUrlParam('token');
store.dispatch('setToken',token);
goOn()
// 通过cookie获取token
}else if(Cookie.get('cc_token')) {
store.dispatch('setToken', Cookie.get('cc_token'));
goOn()
// 无需token登录页面
}else if(to.meta.skip_login){
goOn()
}else{
next({name:'author',query:{retUrl:to.fullPath}})
}
// if(to.meta.skip_login){
// next();
// }
}); });
export default router; export default router;
...@@ -13,10 +13,18 @@ export const getBannerListApi = function () { ...@@ -13,10 +13,18 @@ export const getBannerListApi = function () {
return Vue.prototype.$fetch(getBannerListUrl) return Vue.prototype.$fetch(getBannerListUrl)
}; };
const getwechatParamUrl = `${_baseUrl}api/client/jssdk`; const getwechatParamUrl = `${_baseUrl}api/client/jssdk`;
export const getwechatParam = function () { export const getwechatParam = function (json) {
return Vue.prototype.$fetch(getwechatParamUrl,{api_list:'onMenuShareTimeline,onMenuShareAppMessage'}) return Vue.prototype.$fetch(getwechatParamUrl,json)
}; };
const getGoodsDetailUrl = `${_baseUrl}api/client/goods/info/`; const getGoodsDetailUrl = `${_baseUrl}api/client/goods/info/`;
export const getGoodsDetailApi = function (id) { export const getGoodsDetailApi = function (id) {
return Vue.prototype.$fetch(`${getGoodsDetailUrl}${id}`) return Vue.prototype.$fetch(`${getGoodsDetailUrl}${id}`)
} };
const getUserAdressUrl = `${_baseUrl}api/client/address/info`;
export const getUserAdressApi = function () {
return Vue.prototype.$fetch(getUserAdressUrl)
};
const payUrl = `${_baseUrl}api/client/bill/wechat/pay`
export const payApi = function (json) {
return Vue.prototype.$fetch(payUrl,json)
};
export default{ export default{
setToken({commit},token){
commit('setToken',token);
},
} }
...@@ -6,7 +6,7 @@ Vue.use(vuex); ...@@ -6,7 +6,7 @@ Vue.use(vuex);
export default new vuex.Store({ export default new vuex.Store({
state:{ state:{
token:'',
}, },
mutations, mutations,
actions actions
......
import Cookie from "@/util/cookie";
const mutations={ const mutations={
setToken(state,token){
state.token=token;
Cookie.set('cc_token',token);
},
}; };
export default mutations; export default mutations;
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment