Commit fef3e646 by 赵雅纹

Merge branch 'feature-zyw-sc' into 'dev_7.1.0'

Feature zyw sc

See merge request !109
parents 287167c1 a0bd775d
......@@ -48,7 +48,8 @@
"pages/paymentStatus/paymentStatus",
"pages/fun/fun",
"pages/categoryPro/categoryPro",
"pages/plus/plus"
"pages/plus/plus",
"pages/friendShareList/friendShareList"
]
}
],
......
......@@ -114,36 +114,54 @@ wxService.page({
})
},
//生成卡片
onTapPoster() {
console.log('----------',this.data.proData)
this.data.proData.forEach((item)=>{
item.url = item.productImgUrl
item.title = item.productName
})
if (!this.data.proData){
// 获取选择推广的商品
getChooseExtendPro(){
if (!this.data.proData) {
wx.showToast({
title: '请先选择商品',
icon: 'none'
})
return false;
}
let spreadProducts = []
for (var i in this.data.proData){
spreadProducts.push({
id: this.data.proData[i].productId,
imgUrl: this.data.proData[i].productImgUrl,
name: this.data.proData[i].productName
})
}
console.log(spreadProducts)
wxService.post(`/merchant/spread/save`, {
spreadProducts: spreadProducts
}).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
this.data.proData.forEach((item)=>{
item.url = item.productImgUrl
item.title = item.productName
})
let tentacleInfo = {
content: JSON.stringify(this.data.proData),
contentId: data.id,
contentType: app.globalData.contants.SHARE_TYPE.GOODS, //内容类型 1.文章 2.商品 3.页面
title: this.data.proData[0].productName,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
console.log('4444',tentacleInfo.content)
console.log('4444', tentacleInfo.content)
this.data.currentShareContent = this.data.proData[0];
this.data.currentShareContent = data;
console.log('++++++++++++++++',this.data.currentShareContent)
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/extendProduct/extendProduct?i=' + id + '&t=' + tentacleId;
var path = 'subPackage/page/pages/friendShareList/friendShareList?i=' + id + '&t=' + tentacleId;
this.setData({
showCardModal: true,
cardTitle: this.data.proData[0].productName,
......@@ -152,6 +170,15 @@ wxService.page({
});
}
})
}
}
})
},
//生成卡片
onTapPoster() {
this.getChooseExtendPro()
},
// 获取推广商品列表
......@@ -313,7 +340,8 @@ wxService.page({
console.log('1111111')
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/extendProduct/extendProduct?i=' + id + '&t=' + tentacleId;
var path = 'subPackage/page/pages/friendShareList/friendShareList?i=' + id + '&t=' + tentacleId;
console.log('id', this.data.currentShareContent.id)
console.log(path)
return {
path: path
......
......@@ -23,7 +23,7 @@ wxService.page({
memberLevel: false,
showCardModal: false,
currentShareContent: null,
pageForm : true,
fromZc : false,
},
/**
......@@ -33,7 +33,7 @@ wxService.page({
if (options && options.id) {
this.setData({
productId: options.id,
pageForm: options.fromZc != 1
fromZc: options.fromZc == 1
});
//不是从种草过来的, 需要清除本地临时的触点信息
if (!options.fromZc){
......@@ -237,6 +237,10 @@ wxService.page({
let parmas = {
trolleySku2Buy: JSON.stringify(trolleySku2Buy)
}
//判断是否从种草商品过来购买
if (fromZc){
wxService.updateLocalTentacleInfo();
}
wxService
.router('/pages/confirmOrder/confirmOrder')
.search(parmas)
......
......@@ -127,7 +127,7 @@
bindsubmit="addCart"
report-submit
name='nav'
wx:if="{{pageForm}}"
wx:if="{{!fromZc}}"
>
<button class="cart-button get-formId--btn" formType="submit" >加入购物车</button>
</form>
......
{
"navigationBarTitleText": "",
"usingComponents": {
"go-home": "/component/goHome/goHome"
"go-home": "/component/goHome/goHome",
"buy-image-swiper": "/component/buyImageSwiper/buyImageSwiper"
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@
"list": []
},
"miniprogram": {
"current": 17,
"current": 39,
"list": [
{
"id": -1,
......@@ -299,6 +299,13 @@
"name": "集点列表",
"pathName": "pages/pointList/pointList",
"query": ""
},
{
"id": -1,
"name": "分享列表",
"pathName": "subPackage/page/pages/friendShareList/friendShareList",
"query": "",
"scene": null
}
]
}
......
// pages/coupons.js
const app = getApp()
const wxService = require('../../../../utils/wxService')
const utils = require('../../../../utils/util')
const envInfo = require('../../../../config/index').envInfo
import { Integer } from '../../../../utils/integerDigitalConvertion'
wxService.page({
/**
* 页面的初始数据
*/
data: {
// id: "5d6e2a2338c95504a8de84e8",
id:'',
proList: [],
showCardModal: false,
currentShareContent: null,
pagePath: '',
pageNo: 1,
pageSize: 100,
sharePicData: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
console.log()
if (options && options.id) {
console.log('idididididi',options.id)
this.setData({
id: options.id
})
}
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.getExtendInfo()
this.data.currentShareContent = null;
},
//获取推广商品获取商品id
getExtendInfo() {
console.log(this.data.id)
wxService.post(`/merchant/spread/${this.data.id}`, {}).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0) {
let productIds = []
for (var i in data.spreadProducts){
if (data.spreadProducts[i].id){
productIds.push(data.spreadProducts[i].id)
}
}
this.getByIdExtendProList(productIds)
}
}).finally(() => {
})
},
// 根据商品id,获取商品列表
getByIdExtendProList(productIds){
let params = {
productIds: productIds
}
wxService.post(`/sale/product/buyer/listPage?pageNo=${this.data.pageNo}&pageSize=${this.data.pageSize}`, params).then(res => {
if (!res) return false
const { result, data } = res.data
if (result == 0 && data.content) {
this.setData({
proList: data.content
})
for (var i in data.content){
this.data.sharePicData.push(data.content[i].indexUrl)
this.setData({
sharePicData: this.data.sharePicData
})
}
console.log(this.data.sharePicData)
}
}).finally(() => {
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (res) {
this.data.proList.forEach((item)=>{
item.url = item.indexUrl
item.title = item.productName
item.id = item.productId
})
let tentacleInfo = {
content: JSON.stringify(this.data.proList),
title: '推广商品',
contentType: 3,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let id = Integer.digit(this.data.id, 10, 64);
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `subPackage/page/pages/friendShareList/friendShareList?id=${id}&t=${tentacleId}`;
console.log(path)
return {
path: path
}
}
});
}
})
\ No newline at end of file
{
"navigationBarTitleText": "分享列表",
"usingComponents": {}
}
\ No newline at end of file
<view class='page-friend-share'>
<view class="swiper-image-wrap">
<!-- <buy-image-swiper image-data="{{imageData}}"/>
-->
<swiper autoplay="true" style="height: 750rpx;line-height: 100rpx;" bindchange="swiperChange">
<block wx:for="{{sharePicData}}" wx:key="index">
<swiper-item>
<image class="swiper-image" mode="widthFix" src="{{item}}" />
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{sharePicData}}" wx:key="index">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}" />
</block>
</view>
</view>
<view class="buy-product-wrap">
<view class="buy-product-content">
<block wx:for="{{proList}}" wx:key="{{index}}">
<navigator hover-class="none" url="/pages/productDetail/productDetail?id={{item.productId}}">
<view class="buy-list" data-item="{{contentInfo}}" data-productid="{{item.productId}}">
<view class="prod-img">
<image src="{{item.indexUrl}}" />
</view>
<view class="prod-info">
<view class="prod-name">{{item.productName}}</view>
<!-- <view class="sale-btn">限时特价</view> -->
<view class="bottom-price">
<text class="price">¥{{item.minSalePrice}}</text>
<!-- <text class="cost-price">¥456</text> -->
<view class="look-over">查看详情</view>
</view>
</view>
</view>
</navigator>
</block>
</view>
</view>
</view>
<card-modal
show-card-modal="{{showCardModal}}"
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
/>
<!--goHome-->
<go-home/>
/* subPackage/page/pages/friendShareList/friendShareList.wxss */
@import './../../../../base/base.wxss';
page{
background: #ffffff;
}
.swiper-image-wrap{
height: 750rpx;
}
.swiper-image{
width: 100%;
}
.dots{
position: absolute;
left: 0;
right: 0;
top: 700rpx;
display: flex;
justify-content: center;
}
.dots .dot{
margin: 0 8rpx;
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.25);
transition: all .6s;
}
.dots .dot.active{
width: 22rpx;
height: 10rpx;
background: #C09A74;
border-radius: 20rpx;
}
scroll-view{
height: 100%;
}
.buy-product-wrap{
padding: 0 20rpx;
}
.buy-product-content{
width: 710rpx;
margin-top: 20rpx;
}
.buy-list{
width: 100%;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
display: flex;
margin-bottom: 20rpx;
}
.prod-img{
height: 220rpx;
}
.prod-img image{
width: 220rpx;
height: 220rpx;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
}
.prod-info{
padding: 31rpx 26rpx 39rpx 24rpx;
}
.prod-name{
font-size: 26rpx;
width: 440rpx;
}
.sale-btn{
width: 74rpx;
height: 24rpx;
line-height: 24rpx;
text-align: center;
border-radius: 15rpx;
border: 1px solid rgba(203, 60, 60, 1);
font-size: 13rpx;
color: #CB3C3C;
margin-top: 9rpx;
}
.bottom-price{
margin-top: 11rpx;
}
.price{
font-size: 32rpx;
color: #CB3C3C;
}
.cost-price{
text-decoration:line-through;
font-size: 20rpx;
color: #aaaaaa;
margin-left: 10rpx;
}
.look-over{
width: 125rpx;
height: 39rpx;
line-height: 39rpx;
text-align: center;
border-radius: 19rpx;
background-color: rgba(203, 60, 60, 1);
color: #ffffff;
font-size: 18rpx;
float: right;
}
......@@ -166,7 +166,7 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.tentacleId;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
this.setData({
showCardModal: true,
cardTitle: e.detail.title,
......@@ -206,7 +206,7 @@ wxService.page({
if (res.from != 'menu') {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
......
......@@ -62,7 +62,7 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.tentacleId;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
this.setData({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
......@@ -203,7 +203,7 @@ wxService.page({
if (res.from != 'menu') {
let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/myReleaseDetail/myReleaseDetail?i=' + id + '&t=' + tentacleId;
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
......@@ -219,7 +219,7 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `subPackage/page/pages/myReleaseDetail/myReleaseDetail?t=${tentacleId}`;
var path = `pages/wantToBuyDetail/wantToBuyDetail?t=${tentacleId}`;
return {
path: path
}
......
......@@ -469,6 +469,7 @@ class WXService extends Http {
}
}
});
console.log('--------', args)
//如果打开的是分享界面则进行触点对象信息请求并存储到本地 放到后续的header中
if (pageIsFromShare){
......
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