Commit 1c2aa189 by 施宇

111

parent 8633c642
...@@ -11,7 +11,8 @@ const state = { ...@@ -11,7 +11,8 @@ const state = {
loading: false, loading: false,
addressInfo:"", addressInfo:"",
submitState:false, submitState:false,
ypGoodDetail:{} ypGoodDetail:{},
ordernum:''
} }
const mutations = { const mutations = {
recvlistSample(state, payload) { recvlistSample(state, payload) {
...@@ -36,7 +37,7 @@ const actions = { ...@@ -36,7 +37,7 @@ const actions = {
}); });
}, },
selfSampleCreate({commit}, payload) { selfSampleCreate({commit}, payload) {
// state.loading = true; state.loading = true;
var params = { var params = {
goods_id: payload.goods_id, goods_id: payload.goods_id,
apply_num: payload.apply_num, apply_num: payload.apply_num,
...@@ -47,14 +48,15 @@ const actions = { ...@@ -47,14 +48,15 @@ const actions = {
} }
Services.selfSampleCreate(qs.stringify(params)).then((res) => { Services.selfSampleCreate(qs.stringify(params)).then((res) => {
let data = res.data; let data = res.data;
// state.loading = false; state.loading = false;
if (data.err_code == 0) { if (data.err_code == 0) {
state.submitState=true; state.submitState=true;
state.ordernum = data.data||''
}else{ }else{
Toast(data.err_msg); Toast(data.err_msg);
} }
}).catch(function (err) { }).catch(function (err) {
// state.loading = false; state.loading = false;
}); });
}, },
getDetailYp({commit}, payload) { getDetailYp({commit}, payload) {
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
shareObj:{ shareObj:{
title: "好物分享给你,帮我助力,我们一起免费拿样品", // 分享标题 title: "好物分享给你,帮我助力,我们一起免费拿样品", // 分享标题
desc: "在吗?拜托帮我点一下,你也能免费申请元器件样品~帮我助力 你拿样品", // 分享描述 desc: "在吗?拜托帮我点一下,你也能免费申请元器件样品~帮我助力 你拿样品", // 分享描述
link:this.url, // link:this.url,
// link: window.location.origin+"/v3/samplereg?uid="+util.getCookie("Yo4teW_uid"), // 分享链接 link: window.location.origin+"/v3/samplereg?uid="+util.getCookie("Yo4teW_uid"), // 分享链接
imgUrl: "http://img.ichunt.com/images/ichunt/self_sample/apply.png", // 分享图标 imgUrl: "http://img.ichunt.com/images/ichunt/self_sample/apply.png", // 分享图标
success: function (resp) { success: function (resp) {
...@@ -56,9 +56,8 @@ ...@@ -56,9 +56,8 @@
share(){ share(){
var self=this; var self=this;
// 微信配置 // 微信配置
console.log(self.wxShareInfo)
wx.config({ wx.config({
debug: true, debug: false,
appId: self.wxShareInfo.appId, appId: self.wxShareInfo.appId,
timestamp: self.wxShareInfo.timestamp, timestamp: self.wxShareInfo.timestamp,
nonceStr: self.wxShareInfo.nonceStr, nonceStr: self.wxShareInfo.nonceStr,
......
...@@ -159,18 +159,18 @@ export default { ...@@ -159,18 +159,18 @@ export default {
"/v3/login?referer=" + encodeURIComponent(window.location.href); "/v3/login?referer=" + encodeURIComponent(window.location.href);
return; return;
} else { } else {
const toast = Toast({ const toast = Toast({
type: "loading", type: "loading",
message: "领取中", message: "领取中",
forbidClick: true, forbidClick: true,
duration: 0 duration: 0
}); });
Services.getUserSampleInfo() Services.getUserSampleInfo()
.then(res => { .then(res => {
toast.clear();
let data = res.data; let data = res.data;
if (data.err_code == 0) { if (data.err_code == 0) {
if (data.data.apply_count != 0) { if (data.data.apply_count != 0) {
toast.clear();
me.$router.push({ me.$router.push({
path: "/sampleapply", path: "/sampleapply",
query: { query: {
...@@ -180,8 +180,12 @@ export default { ...@@ -180,8 +180,12 @@ export default {
} else { } else {
me.getPop = true; me.getPop = true;
} }
} else { } else if(data.err_code == '11012'){
toast.clear(); Toast.fail("登录已超时,请重新登录");
window.location.href =
"/v3/login?referer=" + encodeURIComponent(window.location.href);
}else{
Toast.fail("领取失败"); Toast.fail("领取失败");
} }
}) })
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<div class="mask"></div> <div class="mask"></div>
<div class="get-user-con"> <div class="get-user-con">
<h3>恭喜获得1次免费申请样品机会<i class="icon iconfont icon-guanbi" @click="getuserf"></i></h3> <h3>恭喜获得1次免费申请样品机会<i class="icon iconfont icon-guanbi" @click="getuserf"></i></h3>
<p>样品订单编号:12019071090943</p> <p>样品订单编号:{{ordernum}}</p>
<h2>邀请好友注册可额外获得一次样品申请机会,多邀多得</h2> <h2>邀请好友注册可额外获得一次样品申请机会,多邀多得</h2>
<span v-shareMask>点击邀请</span> <span v-shareMask>点击邀请</span>
<div class="tips">重要提醒:审核结果​​将以短信通知给您</div> <div class="tips">重要提醒:审核结果​​将以短信通知给您</div>
...@@ -94,7 +94,8 @@ ...@@ -94,7 +94,8 @@
apply_num:"", apply_num:"",
com_name:"", com_name:"",
sample_demand_desc:"", sample_demand_desc:"",
shareUrl:window.location.origin+"/v3/samplereg?uid="+util.getCookie("Yo4teW_uid") shareUrl:window.location.origin+"/v3/samplereg?uid="+util.getCookie("Yo4teW_uid"),
} }
}, },
computed: { computed: {
...@@ -104,6 +105,7 @@ ...@@ -104,6 +105,7 @@
addressInfo: state => state.sampleapply.addressInfo, addressInfo: state => state.sampleapply.addressInfo,
ypGoodDetail: state => state.sampleapply.ypGoodDetail, ypGoodDetail: state => state.sampleapply.ypGoodDetail,
submitState: state => state.sampleapply.submitState, submitState: state => state.sampleapply.submitState,
ordernum:state => state.sampleapply.ordernum,
}) })
}, },
watch:{ watch:{
...@@ -132,7 +134,8 @@ ...@@ -132,7 +134,8 @@
}, },
methods: { methods: {
getuserf(){ getuserf(){
this.successPop=false; this.successPop=false;
window.location.href='/v3/user/order';
}, },
submitS(){ submitS(){
var self=this; var self=this;
......
...@@ -4266,7 +4266,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core ...@@ -4266,7 +4266,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.2.5@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.9.0@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n loading: false,\n addressInfo: \"\",\n submitState: false,\n ypGoodDetail: {}\n};\nvar mutations = {\n recvlistSample: function recvlistSample(state, payload) {\n state.addressInfo = payload.data.filter(function (item) {\n return item['is_default'] == 1;\n });\n state.addressInfo = state.addressInfo[0];\n }\n};\nvar actions = {\n recvlistSample: function recvlistSample(_ref, payload) {\n var commit = _ref.commit;\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].recvlist().then(function (res) {\n var data = res.data; // state.loading = false;\n\n if (data.err_code == 0) {\n commit({\n type: 'recvlistSample',\n data: data.data\n });\n }\n }).catch(function (err) {});\n },\n selfSampleCreate: function selfSampleCreate(_ref2, payload) {\n var commit = _ref2.commit;\n // state.loading = true;\n var params = {\n goods_id: payload.goods_id,\n apply_num: payload.apply_num,\n com_name: payload.com_name,\n sample_demand_desc: payload.sample_demand_desc,\n address_id: payload.address_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].selfSampleCreate(qs.stringify(params)).then(function (res) {\n var data = res.data; // state.loading = false;\n\n if (data.err_code == 0) {\n state.submitState = true;\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {// state.loading = false;\n });\n },\n getDetailYp: function getDetailYp(_ref3, payload) {\n var commit = _ref3.commit;\n state.loading = true;\n var Params_ = {\n id: payload.data.id\n };\n var params = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams(Params_);\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].getSampleInfo(params).then(function (res) {\n var data = res.data;\n state.loading = false;\n\n if (data.err_code == 0) {\n state.ypGoodDetail = data.data;\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {\n state.loading = false;\n });\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/sample/sampleapply.js?"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.10@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.2.5@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.9.0@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n loading: false,\n addressInfo: \"\",\n submitState: false,\n ypGoodDetail: {},\n ordernum: ''\n};\nvar mutations = {\n recvlistSample: function recvlistSample(state, payload) {\n state.addressInfo = payload.data.filter(function (item) {\n return item['is_default'] == 1;\n });\n state.addressInfo = state.addressInfo[0];\n }\n};\nvar actions = {\n recvlistSample: function recvlistSample(_ref, payload) {\n var commit = _ref.commit;\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].recvlist().then(function (res) {\n var data = res.data; // state.loading = false;\n\n if (data.err_code == 0) {\n commit({\n type: 'recvlistSample',\n data: data.data\n });\n }\n }).catch(function (err) {});\n },\n selfSampleCreate: function selfSampleCreate(_ref2, payload) {\n var commit = _ref2.commit;\n state.loading = true;\n var params = {\n goods_id: payload.goods_id,\n apply_num: payload.apply_num,\n com_name: payload.com_name,\n sample_demand_desc: payload.sample_demand_desc,\n address_id: payload.address_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].selfSampleCreate(qs.stringify(params)).then(function (res) {\n var data = res.data;\n state.loading = false;\n\n if (data.err_code == 0) {\n state.submitState = true;\n state.ordernum = data.data || '';\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {\n state.loading = false;\n });\n },\n getDetailYp: function getDetailYp(_ref3, payload) {\n var commit = _ref3.commit;\n state.loading = true;\n var Params_ = {\n id: payload.data.id\n };\n var params = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getParams(Params_);\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].getSampleInfo(params).then(function (res) {\n var data = res.data;\n state.loading = false;\n\n if (data.err_code == 0) {\n state.ypGoodDetail = data.data;\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {\n state.loading = false;\n });\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/sample/sampleapply.js?");
/***/ }), /***/ }),
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 sign in to comment