瀑布流与短连接

main
syt 7 months ago
parent e877b1f291
commit d6c60d2738
  1. 4
      api/goods/index.js
  2. 2
      config.js
  3. 39
      pages/goods/detail.vue
  4. 7
      pages/goods/list.vue
  5. 2
      pages/news/rules/index.vue
  6. 6
      uni_modules/vk-uview-ui/components/u-waterfall/u-waterfall.vue

@ -14,6 +14,10 @@ const api = {
presale:'goods/presale'
}
// 短连接
export const goodsShortUrl = (param, option) => {
return request.post('goods/shortUrl', param, option)
}
// 商品价格修改
export const editGoodsPrice = (param, option) => {
return request.post('StoreKeeper/editGoodsPrice', param, option)

@ -15,7 +15,7 @@ export default {
* 可在超管后台-商城列表中查看10025
*/
storeId: wx.getExtConfigSync().store_id? wx.getExtConfigSync().store_id : 10048,
storeId: wx.getExtConfigSync().store_id? wx.getExtConfigSync().store_id : 10045,
// storeId: 10037,

@ -465,6 +465,7 @@
},
data() {
return {
options: {},
timestamp: new Date().getTime(),
goods_sku_no: "",
isTodo: false,
@ -529,6 +530,7 @@
},
onLoad(options) {
const that = this;
that.options = options;
let result = uni.getStorageSync("addressResult")
this.addressResult = result ? result.address_component : this.addressResult
this.isPre = options.isPre ? options.isPre : null
@ -1100,10 +1102,18 @@
this.isTodo = true;
this.openDialog = false;
},
toHaibao(index) {
this.shareCancel();
if (index == 2) {
let str = `型号:${this.goods.goods_name}\n前台价:¥${this.goods.goods_price_max}\n推广价:¥${this.goods.goods_price_min}\nSKU:${this.goods.goods_no}\n京东链接:https://item.jd.com/${this.goods.goods_no}.html`
//
async toQueryShortUrl() {
//
const that = this;
//
const params = that.$getShareUrlParams(this.options)
const res = await GoodsApi.goodsShortUrl({
page_url: `pages/goods/detail?${params}`,
page_title: that.goods.goods_name
})
if(res.data.url){
let str = `型号:${that.goods.goods_name}\n前台价:¥${that.goods.goods_price_max}\n推广价:¥${that.goods.goods_price_min}\nSKU:${that.goods.goods_no}\n小程序链接:${res.data.url}`
uni.setClipboardData({
data: str, // value
success: function() {
@ -1115,6 +1125,20 @@
})
}
})
}else{
uni.showToast({
title: '复制失败',
icon: 'none',
duration: 2000
})
}
},
toHaibao(index) {
this.shareCancel();
if (index == 2) {
this.toQueryShortUrl();
} else {
this.openDialog = false
this.showGoodsPosterPopup = true;
@ -1127,9 +1151,7 @@
onShareAppMessage() {
const app = this
//
const params = app.$getShareUrlParams({
goodsId: app.goodsId,
})
const params = app.$getShareUrlParams(this.options)
return {
title: app.goods.goods_name,
imageUrl: app.goods.goods_image,
@ -1144,10 +1166,11 @@
*/
onShareTimeline() {
const app = this
const params = app.$getShareUrlParams(this.options)
return {
title: app.goods.goods_name,
imageUrl: app.goods.goods_image,
path: `/pages/goods/detail?goodsId=${app.goodsId}`
path: `/pages/goods/detail?${params}`
}
}
}

@ -114,6 +114,7 @@
<!-- 商品图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
</view>
<view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 -->
@ -169,6 +170,7 @@
<!-- 商品图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.goods_image"></image>
<!-- <u-lazy-load threshold="0" border-radius="10" image-mode="aspectFill" :loading-img="item.goods_image" :image="item.goods_image" :index="index"></u-lazy-load> -->
</view>
<view class="detail" style="padding-top: 10rpx;">
<!-- 商品名称 -->
@ -236,7 +238,7 @@
} from '@/core/app'
import Search from '@/components/search'
const pageSize = 15
const pageSize = 10
const showViewKey = 'GoodsList-ShowView';
import * as cstegory from '@/api/category'
export default {
@ -443,7 +445,8 @@
const newList = result.data.list
console.log(newList)
let arr = getMoreListData(newList, app.list, pageNo);
app.list.data = app.arrayUnique(arr, 'goods_id')
// app.list.data = app.arrayUnique(arr, 'goods_id')
app.list.data = arr;
app.total = result.data.list.total;
console.log(newList)
resolve(newList)

@ -20,7 +20,7 @@
onLoad(options){
this.itemInfo = JSON.parse(decodeURIComponent(options.itemInfo))
this.title = this.itemInfo.title;
this.strings = this.itemInfo.content.replace(/style=\"text-wrap: nowrap;\"/g,'style=\"text-wrap: inherit;\"');;
this.strings = this.itemInfo.content.replace(/style=\"text-wrap: nowrap;\"/g,'style=\"text-wrap: inherit;\"');
},
methods:{

@ -38,13 +38,13 @@ export default {
// ms
addTime: {
type: [Number, String],
default: 200
default: 300
},
// ididKey{idx: 22, name: 'lisa'}
// idKeyidx
idKey: {
type: String,
default: "id"
default: "goods_id"
}
},
data() {
@ -106,6 +106,8 @@ export default {
this.rightList.push(item);
}
}
// console.log("this.leftList",this.leftList)
// console.log("this.rightList",this.rightList)
//
this.tempList.splice(0, 1);
//

Loading…
Cancel
Save