Commit 7393afe0 authored by zhengke's avatar zhengke

修改

parent 70318f23
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
this.init(); this.init();
}, },
clickHandler(item) { clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.Id }); uni.navigateTo({ url: '/pages/goods/goods?GoodsId=' + item.id });
}, },
init() { init() {
this.CategoryIdsList = []; this.CategoryIdsList = [];
......
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
<view class="good-img"> <view class="good-img">
<image <image
mode="aspectFill" mode="aspectFill"
:src="cx.CoverImage" :src="cx.cover_pic"
style="width: 100%; height: 100%;" style="width: 100%; height: 100%;"
/> />
</view> </view>
<view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.Name }}</view> <view class="good-name" v-if="setting.is_show_goods_name=='1'">{{ cx.name }}</view>
<view class="good-info"> <view class="good-info">
<view class="price" :style="{ color: mainColor }"> <view class="price" :style="{ color: mainColor }">
{{cx.SellingPrice}}</view> {{cx.price}}</view>
<!-- v-if="setting.is_show_sales_num=='1'" --> <!-- v-if="setting.is_show_sales_num=='1'" -->
<view class="sell">已售{{ cx.SalesNum }}</view> <view class="sell">{{ cx.sales }}</view>
<view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)"> <view v-if="setting.is_show_cart=='1'" class="cart" @click.stop="showSkuHandler(cx)">
<u-icon name="cart-o" size="40" :color="mainColor" /> <u-icon name="cart-o" size="40" :color="mainColor" />
</view> </view>
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
}, },
methods: { methods: {
initConfig() { initConfig() {
this.setting = uni.getStorageSync("basedata").mall.setting this.setting = uni.getStorageSync("basedata").setting
}, },
clickHandler(item) { clickHandler(item) {
console.log("GoodsId",item) console.log("GoodsId",item)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
class="good-four" class="good-four"
v-for="(item, gli) in goodList" v-for="(item, gli) in goodList"
:key="gli" :key="gli"
@click="openGood(item.page_url)" @click="openGood(item)"
:style="{ :style="{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '', border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: background:
...@@ -99,14 +99,12 @@ export default { ...@@ -99,14 +99,12 @@ export default {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
openGood(url) { openGood(item) {
uni.navigateTo({ uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id});
url: url
});
}, },
showSkuHandler(g){ showSkuHandler(g){
this.sku=g this.sku=g
this.showSku=true this.showSku=true
}, },
//格式化价格添加.00 //格式化价格添加.00
// getPrice(value){ // getPrice(value){
......
...@@ -231,7 +231,9 @@ export default { ...@@ -231,7 +231,9 @@ export default {
isExsitGoods: true, isExsitGoods: true,
pageTitle: "商品详情", pageTitle: "商品详情",
setting:{}, setting:{},
prevPage:"" prevPage:"",
//自定义接手传递
opTionObj:{}
}; };
}, },
components: { components: {
...@@ -241,12 +243,14 @@ export default { ...@@ -241,12 +243,14 @@ export default {
auth, auth,
}, },
onLoad(option) { onLoad(option) {
this.id = option.id ? option.id : 46942; //40887 59512 46942 console.log(option,'optionnnn');
this.opTionObj=option;
this.id = option.GoodsId ? option.GoodsId : 46942; //40887 59512 46942
this.init(); this.init();
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary; this.secondary = this.$uiConfig.secondary;
this.initPage(); this.initPage();
this.setting = uni.getStorageSync("basedata").mall.setting this.setting = uni.getStorageSync("basedata").setting
}, },
methods: { methods: {
initPage() { initPage() {
...@@ -271,17 +275,16 @@ export default { ...@@ -271,17 +275,16 @@ export default {
}, },
init() { init() {
this.loading = true; this.loading = true;
this.request( this.request2(
{ {
url: "", url: "/api/AppletGoods/GetAppletGoodsInfo",
data: { data: {
r: "api/goods/detail", GoodsId: this.opTionObj.GoodsId
id: this.id,
}, },
}, },
(res) => { (res) => {
console.log(res); console.log(res,'详情');
if (res.code == 0) { if (res.resultCode == 1) {
this.g = res.data.goods; this.g = res.data.goods;
this.g.pic_url.forEach((x) => { this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url); this.imgs.push(x.pic_url);
...@@ -303,6 +306,7 @@ export default { ...@@ -303,6 +306,7 @@ export default {
this.detailContent = richtext; this.detailContent = richtext;
this.loading = false; this.loading = false;
this.initComments(); this.initComments();
this.initRecommend();
} else { } else {
this.isExsitGoods = false; this.isExsitGoods = false;
} }
...@@ -343,22 +347,20 @@ export default { ...@@ -343,22 +347,20 @@ export default {
}, },
(res) => { (res) => {
this.comments = res.data; this.comments = res.data;
this.initRecommend(); // this.initRecommend();
} }
); );
}, },
initRecommend() { initRecommend() {
this.request( this.request2(
{ {
url: "", url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: { data: {
r: "api/goods/new-recommend", RecommendType: 1,
goods_id: this.id,
type: "goods",
}, },
}, },
(res) => { (res) => {
this.recommend = res.data.list; this.recommend = res.data.List;
} }
); );
}, },
......
...@@ -166,18 +166,17 @@ export default { ...@@ -166,18 +166,17 @@ export default {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
}, },
methods: { methods: {
//为你推荐
initRecommend() { initRecommend() {
this.request( this.request2(
{ {
url: "", url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
data: { data: {
r: "api/goods/new-recommend", RecommendType:1
goods_id: 0,
type: "goods",
}, },
}, },
(res) => { (res) => {
this.recommedGoods = res.data.list; this.recommedGoods = res.data.List;
} }
); );
}, },
...@@ -249,20 +248,23 @@ export default { ...@@ -249,20 +248,23 @@ export default {
this.isover = false; this.isover = false;
this.loading = true; this.loading = true;
this.showLoading = this.page != 1; this.showLoading = this.page != 1;
this.request( this.request2(
{ {
url: "", url: "/api/AppletGoods/GetAppletGoodsPageListForZY",
data: { data: {
r: "api/default/goods-list", pageIndex:1,
page: this.page, pageSize:20,
keyword: this.searchKey, Name:this.searchKey,
sign: "", GoodsType:0,
CategoryIds:'',
OrderBy:1
}, },
}, },
(res) => { (res) => {
console.log(res,'搜索ress');
this.showLoading = true; this.showLoading = true;
this.g = this.g.concat(res.data.list); this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pagination.page_count; this.page_count = res.data.page_count;
if (this.page_count == 1) { if (this.page_count == 1) {
this.isover = true; this.isover = true;
this.status = "nomore"; this.status = "nomore";
......
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