Commit b77ee529 by 肖康

阿斯达

parent 28d40408
Showing with 139 additions and 30 deletions
......@@ -361,6 +361,8 @@ export const apis = {
defaultClass: productionUrl + 'api/defaultClass',
/******添加到购物车或者下单 */
addGood: productionUrlApi + '/cart/add',
/******自营样片订单提交接口 */
selfSampleCreate: productionUrlApi + 'order/selfsamplecreate',
/**
......@@ -653,5 +655,8 @@ export const services = {
wxShare(params) {
return axios.post(apis.wxShare, params)
},
selfSampleCreate(params) {
return axios.post(apis.selfSampleCreate, params)
},
};
\ No newline at end of file
......@@ -342,6 +342,7 @@ const routes = [{
},
{
path: '/sampleapply',
name:"sampleapply",
component: sampleapply,
meta: {
title: '样片申请'
......
......@@ -10,6 +10,7 @@ Vue.use(Toast);
const state = {
loading: false,
addressInfo:"",
submitState:false
}
const mutations = {
recvlistSample(state, payload) {
......@@ -33,6 +34,28 @@ const actions = {
}).catch(function (err) {
});
},
selfSampleCreate({commit}, payload) {
state.loading = true;
var params = {
goods_id: payload.goods_id,
apply_num: payload.apply_num,
com_name: payload.com_name,
sample_demand_desc: payload.sample_demand_desc,
address_id: payload.address_id
}
Services.selfSampleCreate(qs.stringify(params)).then((res) => {
let data = res.data;
state.loading = false;
if (data.err_code == 0) {
this.state.submitState=true;
}
}).catch(function (err) {
state.loading = false;
});
},
}
const getters = {}
......
......@@ -19,13 +19,13 @@
shareObj:{
title: "好物分享给你,帮我助力,我们一起免费拿样品", // 分享标题
desc: "在吗?拜托帮我点一下,你也能免费申请元器件样品~帮我助力 你拿样品", // 分享描述
// 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", // 分享图标
success: function (resp) {
},
error:function(){
alert("错误")
}
}
}
......@@ -64,26 +64,16 @@
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在 页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready 函数中。
wx.ready(function(){
wx.checkJsApi({
jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function(res) {
alert("检测成功")
// console.log(res);
// 以键值对的形式返回,可用的api值true,不可用为false
// 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
}
});
// 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
wx.onMenuShareTimeline({
title: "好物分享给你,帮我助力,我们一起免费拿样品", // 分享标题
desc: "在吗?拜托帮我点一下,你也能免费申请元器件样品~帮我助力 你拿样品", // 分享描述
link: window.location.origin+"/v3/samplereg?uid="+util.getCookie("Yo4teW_uid"), // 分享链接
imgUrl: "http://img.ichunt.com/images/ichunt/self_sample/apply.png", // 分享图标
success: function (resp) {
alert("成功")
},
error:function(){
alert("错误")
}
});
wx.onMenuShareTimeline(self.shareObj);
// 获取“分享给朋友”按钮点击状态及自定义分享内容接口
wx.onMenuShareAppMessage(self.shareObj);
//获取“分享到QQ”按钮点击状态及自定义分享内容接口
......
......@@ -5,21 +5,20 @@
<van-collapse-item title="商品信息" name="1" :border="noborder">
<div class="info-con clr">
<div class="fl img-box">
<img src="static/images/news.png" alt="">
<img :src="zygoodDetail.goods_images||'static/images/news.png'" alt="">
</div>
<div class="fr cb-box">
<div class="title">TL431-DSFSDFSDFS-2ffF...</div>
<p><span>类别:</span> 贴片电容贴片电容贴片电容贴电容...</p>
<p><span>品牌:</span> EYANG(宇阳)EYANG(宇阳)...</p>
<div class="title">{{zygoodDetail.goods_name}}</div>
<p><span>类别:</span> {{zygoodDetail.class1_name}}</p>
<p><span>品牌:</span>{{zygoodDetail.brand_name}}</p>
<p><span>最大可申请数量:</span>2</p>
</div>
</div>
<div class="info-detail">
<p><span>型号: </span>431-DSFSDFSDFS-2ffFF2ffFSDFSDFS-2ffFF2fSDFS2f...</p>
<p><span>型号: </span>{{zygoodDetail.sku_name}}</p>
<p class="canshudetail">
<span>参数描述: </span>L1N4148WT1G 开关二极管 SOD-123 由LRC(乐山无线
电)设计生产制造,在猎芯网自营现货销售。L1N4148WT1G的封装
/规格参数为:SOD-123;您可以选择下载L1N4148WT1G 开关...
<span>参数描述: </span>
{{zygoodDetail.sku_name}}{{zygoodDetail.brand_name}}设计生产制造,在猎芯网自营现货销售。{{zygoodDetail.goods_name}}的封装/规格参数为:{{zygoodDetail.encap}};您可以选择下载{{zygoodDetail.sku_name}}中文资料等数据手册功能说明书,资料中有{{zygoodDetail.class_id1_name}}{{zygoodDetail.class_id2_name}}详细使用方法及教程。
</p>
</div>
</van-collapse-item>
......@@ -28,15 +27,15 @@
<div class="form-info">
<div class="form-group">
<h3><span class="f-red">*</span>&nbsp;&nbsp;商品信息</h3>
<input type="text" placeholder="请输入申请数量,最多可申请2个" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}"/>
<input type="text" v-model="apply_num" placeholder="请输入申请数量,最多可申请2个" onkeyup="if(event.keyCode !=37 &amp;&amp; event.keyCode != 39){if (!/^[\d]+$/ig.test(this.value)){this.value='';}}"/>
</div>
<div class="form-group">
<h3><span class="f-red">*</span>&nbsp;&nbsp;单位名称</h3>
<input type="text" placeholder="请输入单位名称" />
<input type="text" v-model="com_name" placeholder="请输入单位名称" />
</div>
<div class="form-group">
<h3><span class="f-red">*</span>&nbsp;&nbsp;项目需求描述</h3>
<textarea name="" placeholder="请输项目需求描述,如申请样品用于什么项目"></textarea>
<textarea name="" v-model="sample_demand_desc" placeholder="请输项目需求描述,如申请样品用于什么项目"></textarea>
</div>
<div class="form-group by">
<h3>运费信息 <span class="fr">包邮</span></h3>
......@@ -65,6 +64,7 @@
<div class="tips">重要提醒:审核结果​​将以短信通知给您</div>
</div>
</div>
<van-loading type="spinner" color="#000" class="loading-background" v-if="loading"/>
</section>
</template>
......@@ -74,8 +74,8 @@
import Vue from 'vue'
import {mapState} from 'vuex'
import Header from "@/views/common/Header.vue";
import { Collapse, CollapseItem } from 'vant';
Vue.use(Collapse).use(CollapseItem);
import { Collapse, CollapseItem ,Toast,Loading} from 'vant';
Vue.use(Collapse).use(CollapseItem).use(Toast).use(Loading);
export default {
name: 'sampleapply',
data() {
......@@ -87,18 +87,34 @@
activeName:'1',
noborder:false,
successPop:false,//申请成功弹窗显示
goods_id:this.$route.query.id,
apply_num:"",
com_name:"",
sample_demand_desc:"",
}
},
computed: {
...mapState({
loading: state => state.sampleapply.loading,
addressInfo: state => state.sampleapply.addressInfo,
zygoodDetail: state => state.gooddetail.zygoodDetail,
submitState: state => state.sampleapply.submitState,
})
},
watch:{
submitState(val){
if(val){
this.successPop=true;
}
}
},
created() {
this.$store.dispatch({
type: "getDetailData",
data: { id: this.goods_id }
});
this.$store.dispatch({
type: 'recvlistSample'
})
},
......@@ -107,7 +123,28 @@
this.successPop=false;
},
submitS(){
this.successPop=true;
var self=this;
if(!this.apply_num){
Toast("请输入申请数量");
return;
}
if(!this.com_name){
Toast("请输入单位名称");
return;
}
if(!this.sample_demand_desc){
Toast("请输入项目需求描述");
return;
}
this.$store.dispatch({
type: 'selfSampleCreate',
goods_id: self.goods_id,
apply_num: self.apply_num,
com_name: self.com_name,
sample_demand_desc: self.sample_demand_desc,
address_id: self.addressInfo.address_id
})
},
addressSample(adderssId){
window.location.href='/h5/view/#/userAddress?points='+adderssId;
......
{"h":"9520eeba068a14661f70","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"b95903a69dfcfced1f83","c":{"app":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"236d0ea6edde812965cf","c":{"28":true}}
\ No newline at end of file
{"h":"966349ed92e956ed13b2","c":{"app":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"84b9c72b8899081d209e","c":{"28":true}}
\ No newline at end of file
{"h":"64223c2d06ef8ed91876","c":{"28":true}}
\ No newline at end of file
{"h":"128fb48c880125a45ba6","c":{"app":true}}
\ No newline at end of file
webpackHotUpdate(28,{
/***/ "./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"2cbb7265-vue-loader-template\"}!./node_modules/_vue-loader@15.7.1@vue-loader/lib/loaders/templateLoader.js?!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?!./node_modules/_vue-loader@15.7.1@vue-loader/lib/index.js?!./src/views/sample/sampleapply.vue?vue&type=template&id=1a044739&scoped=true&":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"2cbb7265-vue-loader-template"}!./node_modules/_vue-loader@15.7.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.1@vue-loader/lib??vue-loader-options!./src/views/sample/sampleapply.vue?vue&type=template&id=1a044739&scoped=true& ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function () {}\nvar staticRenderFns = []\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvX2NhY2hlLWxvYWRlckAyLjAuMUBjYWNoZS1sb2FkZXIvZGlzdC9janMuanM/e1wiY2FjaGVEaXJlY3RvcnlcIjpcIm5vZGVfbW9kdWxlcy8uY2FjaGUvdnVlLWxvYWRlclwiLFwiY2FjaGVJZGVudGlmaWVyXCI6XCIyY2JiNzI2NS12dWUtbG9hZGVyLXRlbXBsYXRlXCJ9IS4vbm9kZV9tb2R1bGVzL192dWUtbG9hZGVyQDE1LjcuMUB2dWUtbG9hZGVyL2xpYi9sb2FkZXJzL3RlbXBsYXRlTG9hZGVyLmpzPyEuL25vZGVfbW9kdWxlcy9fY2FjaGUtbG9hZGVyQDIuMC4xQGNhY2hlLWxvYWRlci9kaXN0L2Nqcy5qcz8hLi9ub2RlX21vZHVsZXMvX3Z1ZS1sb2FkZXJAMTUuNy4xQHZ1ZS1sb2FkZXIvbGliL2luZGV4LmpzPyEuL3NyYy92aWV3cy9zYW1wbGUvc2FtcGxlYXBwbHkudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTFhMDQ0NzM5JnNjb3BlZD10cnVlJi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL3NyYy92aWV3cy9zYW1wbGUvc2FtcGxlYXBwbHkudnVlPzFhNjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHJlbmRlciA9IGZ1bmN0aW9uICgpIHt9XG52YXIgc3RhdGljUmVuZGVyRm5zID0gW11cblxuZXhwb3J0IHsgcmVuZGVyLCBzdGF0aWNSZW5kZXJGbnMgfSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"2cbb7265-vue-loader-template\"}!./node_modules/_vue-loader@15.7.1@vue-loader/lib/loaders/templateLoader.js?!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?!./node_modules/_vue-loader@15.7.1@vue-loader/lib/index.js?!./src/views/sample/sampleapply.vue?vue&type=template&id=1a044739&scoped=true&\n");
/***/ })
})
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"d99c923614e45fb20d87","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"39e7927d7de1b4641ed4","c":{"28":true}}
\ No newline at end of file
{"h":"745cf6b05e2ae427e2c1","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
{"h":"ecc2837d9e21984ba364","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
{"h":"73753a44e488d6552bc4","c":{"app":true}}
\ No newline at end of file
{"h":"5c45c7b1fa3ba65ecec4","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
{"h":"240e7a6647c42ad64460","c":{"28":true}}
\ No newline at end of file
{"h":"881f631780db402f27d0","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
{"h":"64fe62c6b5130da59f45","c":{"28":true}}
\ No newline at end of file
{"h":"89df769ffc8bdb2d4750","c":{"28":true}}
\ No newline at end of file
{"h":"b27e72bcc7da8eaf1421","c":{"28":true}}
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
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