Commit b0a07f7a by 施宇

Merge branch 'lt_yaohaoyou' into Development

# Conflicts:
#	view/11.js
parents b6125f72 9a0d6938
......@@ -66,6 +66,7 @@ const actions = {
addGoods({
commit
}, payload) {
console.log(payload)
const toast = Toast.loading({
message: '加载中...',
duration: 0,
......@@ -82,8 +83,12 @@ const actions = {
if (payload.data.type == 1) {
window.location.href = "/v3/order/confirm?type=zy&k=" + payload.data.k
} else {
if(payload.invitedId){
window.location.href = "/v3/order/confirm?type=other&k=" + payload.data.k+"&invitedId="+payload.invitedId
}else{
window.location.href = "/v3/order/confirm?type=other&k=" + payload.data.k
}
}
} else {
state.isShowAlert = true;
state.tipText = data.err_msg
......
......@@ -113,6 +113,7 @@ export default {
name: "oscilloscope",
data() {
return {
invitedId:"",
title: "",
meaushow: true,
bgcolor: "#fafafa",
......@@ -121,6 +122,13 @@ export default {
};
},
created(){
let {invitedId} = this.$route.query;
if(invitedId){
SetCookie('sbqinvitedId',invitedId,1);
this.invitedId=invitedId
}else{
getCookie('sbqinvitedId')&&( this.invitedId = getCookie('sbqinvitedId'));
}
this.oscilloscopeinvited();
this.getBannerData();
this.yaoHaoYouJP();
......@@ -170,15 +178,9 @@ export default {
this.animate = false;
     },500)},
oscilloscopeinvited() {
let {invitedId} = this.$route.query;
let userId = util.getCookie("Yo4teW_uid");
let data = {};
if(invitedId){
SetCookie('sbqinvitedId',invitedId,1);
data['invited_uid']=invitedId
}else{
getCookie('sbqinvitedId')&&(data['user_id '] = getCookie('sbqinvitedId'));
}
this.invitedId&&(data['invited_uid '] = this.invitedId);
userId&&(data['user_id '] = userId);
//统计邀请的人数和页面访问统计
this.$store.dispatch({
......@@ -210,7 +212,8 @@ export default {
};
this.$store.dispatch({
type: "addGoods",
data: { datax: datax }
data: { datax: datax },
invitedId:this.invitedId
});
})
},
......
......@@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es7.object.get-own-property-descriptors */ \"./node_modules/_core-js@2.6.11@core-js/modules/es7.object.get-own-property-descriptors.js\");\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom.iterable */ \"./node_modules/_core-js@2.6.11@core-js/modules/web.dom.iterable.js\");\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es6.array.iterator */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.array.iterator.js\");\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es6.object.keys */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.keys.js\");\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty */ \"./node_modules/_@babel_runtime@7.10.2@@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/index */ \"./src/util/index.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.4.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/common/wxShare.vue */ \"./src/views/common/wxShare.vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.8.4@vant/es/index.js\");\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_9__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_10__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_10__[\"SwipeItem\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"oscilloscope\",\n data: function data() {\n return {\n title: \"\",\n meaushow: true,\n bgcolor: \"#fafafa\",\n animate: false,\n shareUrl: window.location.origin + window.location.pathname + (_util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\") ? '#/oscilloscope?invitedId=' + _util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\") : \"#/oscilloscope\")\n };\n },\n created: function created() {\n this.oscilloscopeinvited();\n this.getBannerData();\n this.yaoHaoYouJP();\n this.getYaoHaoYouGoodId();\n },\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapState\"])({\n bannerData: function bannerData(state) {\n return state.oscilloscope.bannerData;\n },\n isLodingFinishData: function isLodingFinishData(state) {\n return state.oscilloscope.isLodingFinishData;\n },\n prizeData: function prizeData(state) {\n return state.oscilloscope.prizeData;\n },\n goodId: function goodId(state) {\n return state.oscilloscope.goodId;\n }\n })),\n watch: {\n isLodingFinishData: function isLodingFinishData(now) {\n var me = this;\n\n if (now) {\n setInterval(this.showMarquee, 2000);\n }\n }\n },\n methods: _objectSpread(_objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapMutations\"])(['changeBannerData'])), {}, {\n getYaoHaoYouGoodId: function getYaoHaoYouGoodId() {\n //获取商品id\n this.$store.dispatch({\n type: \"getYaoHaoYouGoodId\",\n data: {\n \"type_id\": 1\n }\n });\n },\n yaoHaoYouJP: function yaoHaoYouJP() {\n //获取奖品信息\n this.$store.dispatch({\n type: \"yaoHaoYouJP\"\n });\n },\n showMarquee: function showMarquee() {\n var _this = this;\n\n this.animate = true;\n setTimeout(function () {\n _this.changeBannerData();\n\n _this.animate = false;\n }, 500);\n },\n oscilloscopeinvited: function oscilloscopeinvited() {\n var invitedId = this.$route.query.invitedId;\n var userId = _util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\");\n var data = {};\n\n if (invitedId) {\n SetCookie('sbqinvitedId', invitedId, 1);\n data['invited_uid'] = invitedId;\n } else {\n getCookie('sbqinvitedId') && (data['user_id '] = getCookie('sbqinvitedId'));\n }\n\n userId && (data['user_id '] = userId); //统计邀请的人数和页面访问统计\n\n this.$store.dispatch({\n type: \"oscilloscopeinvited\",\n data: _objectSpread({}, data)\n });\n },\n getBannerData: function getBannerData() {\n //获取广告文字轮播\n this.$store.dispatch({\n type: \"getbannerdata\",\n data: {\n 'is_liexin': 1\n }\n });\n },\n buyFun: function buyFun() {\n var _this2 = this;\n\n //立即购买\n this.judgeLogin(function () {\n if (!_this2.goodId) {\n return;\n }\n\n var datax = {\n id: _this2.goodId,\n num: 1,\n buy: 1\n };\n\n _this2.$store.dispatch({\n type: \"addGoods\",\n data: {\n datax: datax\n }\n });\n });\n },\n judgeLogin: function judgeLogin(callback) {\n if (_util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].isLogin() == 1) {\n //已登入\n callback();\n } else {\n //未登入\n window.location.href = '/v3/login?referer=' + encodeURIComponent(window.location.href) + '&ptag=oscilloscope';\n }\n }\n }),\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n wxShare: _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/oscilloscope/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.1.0@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.2@vue-loader/lib??vue-loader-options");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es7.object.get-own-property-descriptors */ \"./node_modules/_core-js@2.6.11@core-js/modules/es7.object.get-own-property-descriptors.js\");\n/* harmony import */ var core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es7_object_get_own_property_descriptors__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom.iterable */ \"./node_modules/_core-js@2.6.11@core-js/modules/web.dom.iterable.js\");\n/* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es6.array.iterator */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.array.iterator.js\");\n/* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es6.object.keys */ \"./node_modules/_core-js@2.6.11@core-js/modules/es6.object.keys.js\");\n/* harmony import */ var core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_object_keys__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty */ \"./node_modules/_@babel_runtime@7.10.2@@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var _util_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../util/index */ \"./src/util/index.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.4.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/common/wxShare.vue */ \"./src/views/common/wxShare.vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.8.4@vant/es/index.js\");\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(E_h5_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_9__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_10__[\"Swipe\"]).use(vant__WEBPACK_IMPORTED_MODULE_10__[\"SwipeItem\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"oscilloscope\",\n data: function data() {\n return {\n invitedId: \"\",\n title: \"\",\n meaushow: true,\n bgcolor: \"#fafafa\",\n animate: false,\n shareUrl: window.location.origin + window.location.pathname + (_util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\") ? '#/oscilloscope?invitedId=' + _util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\") : \"#/oscilloscope\")\n };\n },\n created: function created() {\n var invitedId = this.$route.query.invitedId;\n\n if (invitedId) {\n SetCookie('sbqinvitedId', invitedId, 1);\n this.invitedId = invitedId;\n } else {\n getCookie('sbqinvitedId') && (this.invitedId = getCookie('sbqinvitedId'));\n }\n\n this.oscilloscopeinvited();\n this.getBannerData();\n this.yaoHaoYouJP();\n this.getYaoHaoYouGoodId();\n },\n computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapState\"])({\n bannerData: function bannerData(state) {\n return state.oscilloscope.bannerData;\n },\n isLodingFinishData: function isLodingFinishData(state) {\n return state.oscilloscope.isLodingFinishData;\n },\n prizeData: function prizeData(state) {\n return state.oscilloscope.prizeData;\n },\n goodId: function goodId(state) {\n return state.oscilloscope.goodId;\n }\n })),\n watch: {\n isLodingFinishData: function isLodingFinishData(now) {\n var me = this;\n\n if (now) {\n setInterval(this.showMarquee, 2000);\n }\n }\n },\n methods: _objectSpread(_objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_7__[\"mapMutations\"])(['changeBannerData'])), {}, {\n getYaoHaoYouGoodId: function getYaoHaoYouGoodId() {\n //获取商品id\n this.$store.dispatch({\n type: \"getYaoHaoYouGoodId\",\n data: {\n \"type_id\": 1\n }\n });\n },\n yaoHaoYouJP: function yaoHaoYouJP() {\n //获取奖品信息\n this.$store.dispatch({\n type: \"yaoHaoYouJP\"\n });\n },\n showMarquee: function showMarquee() {\n var _this = this;\n\n this.animate = true;\n setTimeout(function () {\n _this.changeBannerData();\n\n _this.animate = false;\n }, 500);\n },\n oscilloscopeinvited: function oscilloscopeinvited() {\n var userId = _util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].getCookie(\"Yo4teW_uid\");\n var data = {};\n this.invitedId && (data['invited_uid '] = this.invitedId);\n userId && (data['user_id '] = userId); //统计邀请的人数和页面访问统计\n\n this.$store.dispatch({\n type: \"oscilloscopeinvited\",\n data: _objectSpread({}, data)\n });\n },\n getBannerData: function getBannerData() {\n //获取广告文字轮播\n this.$store.dispatch({\n type: \"getbannerdata\",\n data: {\n 'is_liexin': 1\n }\n });\n },\n buyFun: function buyFun() {\n var _this2 = this;\n\n //立即购买\n this.judgeLogin(function () {\n if (!_this2.goodId) {\n return;\n }\n\n var datax = {\n id: _this2.goodId,\n num: 1,\n buy: 1\n };\n\n _this2.$store.dispatch({\n type: \"addGoods\",\n data: {\n datax: datax\n },\n invitedId: _this2.invitedId\n });\n });\n },\n judgeLogin: function judgeLogin(callback) {\n if (_util_index__WEBPACK_IMPORTED_MODULE_6__[\"default\"].isLogin() == 1) {\n //已登入\n callback();\n } else {\n //未登入\n window.location.href = '/v3/login?referer=' + encodeURIComponent(window.location.href) + '&ptag=oscilloscope';\n }\n }\n }),\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n wxShare: _views_common_wxShare_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/oscilloscope/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.1.0@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.9.2@vue-loader/lib??vue-loader-options");
/***/ }),
......
......@@ -4326,7 +4326,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"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.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.8.4@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.9.4@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n zygoodDetail: {},\n lygoodDetail: {},\n isShowAlert: false,\n tipText: \"\"\n};\nvar mutations = {\n changeZyGoodDetail: function changeZyGoodDetail(state, payload) {\n var data = payload.data;\n state.zygoodDetail = data;\n },\n changeLyGoodDetail: function changeLyGoodDetail(state, payload) {\n var data = payload.data;\n state.lygoodDetail = data;\n },\n closeAlert: function closeAlert(state) {\n state.isShowAlert = false, state.tipText = \"\";\n }\n};\nvar actions = {\n getDetailData: function getDetailData(_ref, payload) {\n var commit = _ref.commit;\n var toast = vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"].loading({\n message: '加载中...',\n duration: 0,\n forbidClick: true,\n loadingType: 'spinner'\n });\n state.zygoodDetail = {};\n state.lygoodDetail = {};\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].goodDetail(qs.stringify(payload.data)).then(function (res) {\n toast.clear();\n var data = res.data;\n\n if (data.err_code == 0) {\n if (data.data.goods_type == 3 || data.data.goods_type == 4) {\n //自营\n commit('changeZyGoodDetail', {\n data: data.data\n });\n } else if (data.data.goods_type == 1 || data.data.goods_type == 2) {\n //联营\n commit(\"changeLyGoodDetail\", {\n //过滤数据\n data: data.data\n });\n }\n } else {}\n }).catch(function (err) {\n toast.clear();\n });\n },\n addGoods: function addGoods(_ref2, payload) {\n var commit = _ref2.commit;\n var toast = vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"].loading({\n message: '加载中...',\n duration: 0,\n forbidClick: true\n });\n state.isShowAlert = false;\n state.tipText = \"\";\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].addGood(qs.stringify(payload.data.datax)).then(function (res) {\n toast.clear();\n var data = res.data;\n\n if (data.err_code == 0) {\n if (payload.data.datax.buy == 1) {\n window.sessionStorage.setItem(\"car_xk\", data.data);\n\n if (payload.data.type == 1) {\n window.location.href = \"/v3/order/confirm?type=zy&k=\" + payload.data.k;\n } else {\n window.location.href = \"/v3/order/confirm?type=other&k=\" + payload.data.k;\n }\n } else {\n state.isShowAlert = true;\n state.tipText = data.err_msg;\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {\n toast.clear();\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(err);\n });\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n actions: actions,\n mutations: mutations\n});\n\n//# sourceURL=webpack:///./src/store/modules/gooddetail/gooddetail.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.11@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@2.8.4@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.9.4@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"]);\nvar state = {\n zygoodDetail: {},\n lygoodDetail: {},\n isShowAlert: false,\n tipText: \"\"\n};\nvar mutations = {\n changeZyGoodDetail: function changeZyGoodDetail(state, payload) {\n var data = payload.data;\n state.zygoodDetail = data;\n },\n changeLyGoodDetail: function changeLyGoodDetail(state, payload) {\n var data = payload.data;\n state.lygoodDetail = data;\n },\n closeAlert: function closeAlert(state) {\n state.isShowAlert = false, state.tipText = \"\";\n }\n};\nvar actions = {\n getDetailData: function getDetailData(_ref, payload) {\n var commit = _ref.commit;\n var toast = vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"].loading({\n message: '加载中...',\n duration: 0,\n forbidClick: true,\n loadingType: 'spinner'\n });\n state.zygoodDetail = {};\n state.lygoodDetail = {};\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].goodDetail(qs.stringify(payload.data)).then(function (res) {\n toast.clear();\n var data = res.data;\n\n if (data.err_code == 0) {\n if (data.data.goods_type == 3 || data.data.goods_type == 4) {\n //自营\n commit('changeZyGoodDetail', {\n data: data.data\n });\n } else if (data.data.goods_type == 1 || data.data.goods_type == 2) {\n //联营\n commit(\"changeLyGoodDetail\", {\n //过滤数据\n data: data.data\n });\n }\n } else {}\n }).catch(function (err) {\n toast.clear();\n });\n },\n addGoods: function addGoods(_ref2, payload) {\n var commit = _ref2.commit;\n console.log(payload);\n var toast = vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"].loading({\n message: '加载中...',\n duration: 0,\n forbidClick: true\n });\n state.isShowAlert = false;\n state.tipText = \"\";\n _api_index__WEBPACK_IMPORTED_MODULE_2__[\"services\"].addGood(qs.stringify(payload.data.datax)).then(function (res) {\n toast.clear();\n var data = res.data;\n\n if (data.err_code == 0) {\n if (payload.data.datax.buy == 1) {\n window.sessionStorage.setItem(\"car_xk\", data.data);\n\n if (payload.data.type == 1) {\n window.location.href = \"/v3/order/confirm?type=zy&k=\" + payload.data.k;\n } else {\n if (payload.invitedId) {\n window.location.href = \"/v3/order/confirm?type=other&k=\" + payload.data.k + \"&invitedId=\" + payload.invitedId;\n } else {\n window.location.href = \"/v3/order/confirm?type=other&k=\" + payload.data.k;\n }\n }\n } else {\n state.isShowAlert = true;\n state.tipText = data.err_msg;\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(data.err_msg);\n }\n }).catch(function (err) {\n toast.clear();\n Object(vant__WEBPACK_IMPORTED_MODULE_1__[\"Toast\"])(err);\n });\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n actions: actions,\n mutations: mutations\n});\n\n//# sourceURL=webpack:///./src/store/modules/gooddetail/gooddetail.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