Commit 8f5d5b90 by 赵雅纹

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

Feature zyw sc

See merge request !94
parents 80af50cb 9a99d539
// component/plus/plus.js
Component({
/**
* 组件的属性列表
*/
properties: {
skuList: {
type: Array,
value: [],
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--component/plus/plus.wxml-->
<view class="plus-bottom fixed-bottom0 clearfix::after">
<view class="bottom-top">
<scroll-view scroll-x="true" class="scroll-view_H">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{skuList}}' wx:for-item="sub" wx:key="s">
<view class="upload_Item item-img" style="background-image:url({{sub.mainImgUrl}})">
<view class="item-mouth">每月仅¥ 25</view>
<view class="item-year">全年卡· 366 天</view>
<view class="item-price">¥ 300</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="bottom-bottom">
<view class="bottom-pay">立即支付 ¥158 </view>
</view>
</view>
/* component/plus/plus.wxss */
@import '../../base/base.wxss';
.scroll-view_H{
width: 100%;
}
.plus-bottom {
height: 314rpx;
/* background-color: rgba(192, 154, 116, .02); */
background-color: pink;
}
.plus-bottom .bottom-top {
height: 226rpx;
/* display: flex;
align-items: center; */
}
.pro-list {
/* height: 155rpx; */
background-color: gray;
margin-left: 20rpx;
/* margin-top: 40rpx; */
box-sizing: border-box;
white-space: nowrap;
/* margin: 40rpx 30rpx 0 30rpx; */
}
.item-mouth {
height: 25rpx;
color: rgba(255, 255, 255, 1);
font-size: 18rpx;
}
.item-year {
height: 33rpx;
color: rgba(247, 181, 0, 1);
font-size: 24rpx;
}
.item-price {
height: 50rpx;
color: rgba(245, 248, 250, 1);
font-size: 36rpx;
}
.plus-bottom .bottom-bottom {
width: 100%;
height: 88rpx;
padding-top: 18rpx;
background-color: rgba(255, 255, 255, 1);
}
.bottom-pay {
text-align: center;
width: 280rpx;
line-height: 52rpx;
height: 52rpx;
border-radius: 26px;
background-color: rgba(203, 60, 60, 1);
left: 480px;
color: rgba(255, 255, 255, 1);
font-size: 26rpx;
float: right;
margin-right: 30rpx;
}
.item-img {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.uploadWrap {
/* height: 155rpx; */
height: 100%;
width: 100%;
display: flex;
align-items: center;
display: -webkit-box;
flex-direction: column;
/* margin: 40rpx 30rpx 0 30rpx; */
}
.upload_Item {
width: 209rpx;
height: 155rpx;
flex: 1;
margin: 0rpx 15rpx 15rpx 0;
box-sizing: border-box;
background-color: aqua;
}
.upload_Item:last-child {
margin-right: 20rpx;
}
.upload_Item_img {
width: 209rpx;
height: 155rpx;
}
......@@ -33,6 +33,12 @@ Component({
* 组件的方法列表
*/
methods: {
hidePopup(){
console.log('111')
this.setData({
show: false
})
},
//获取高度
getHeightFun(){
//获取屏幕高度
......
<!--component/shareModal/shareModal.wxml-->
<view class="modal-container" bindtap="hidePopup" hidden="{{!show}}"></view>
<view class="modal-content" hidden="{{!show}}">
<view class="modal-content" hidden="{{!show}}" bindtap="hidePopup">
<image style="height:{{shareHight}}" src="/assets/imgs/7_1_0/share-modal.png"></image>
</view>
<view class="share-modal-list " id="bottom-query" hidden="{{!show}}">
......
// pages/extendProduct/extendProduct.js
Page({
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({
/**
* 页面的初始数据
......@@ -8,14 +14,20 @@ Page({
currentTab: 0,
isAllSelect: false,
showShareModal:false,
shareShowPic: true,
showCardModal: false,
totalPages:0,
currentShareContent: null,
pageNum: 1,
pageSize: 10,
extendProList:[],
myExtendList:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.selectComponent('#getPoster').getAvaterInfo()
},
//滑动切换
......@@ -30,10 +42,11 @@ Page({
}
// 可使用
if (current == 0) {
// this.getCouponList(1, 10, 1)
this.getExtendProList()
} else if (current == 1) {
// 失效
// this.getCouponList(1, 10, 0)
// 我的推广
wx.hideShareMenu();
this.getMyExtendOrderList()
}
},
// 点击切换
......@@ -44,19 +57,44 @@ Page({
} else {
this.setData({
currentTab: current,
// couponList: [], // 清空数据
myExtendList: [], // 清空数据
// invalidCouponList: [],
})
}
// 可使用
if (current == 0) {
// this.getCouponList(1, 10, 1)
this.getExtendProList()
} else if (current == 1) {
// 失效
// this.getCouponList(1, 10, 0)
// 我的推广
wx.hideShareMenu();
this.getMyExtendOrderList()
}
},
// 选择商品
selectPro(e){
let proData = []
let extendProList = this.data.extendProList
var index = e.currentTarget.dataset.index
if (extendProList[index].isSelect) {
extendProList[index].isSelect = false
} else {
extendProList[index].isSelect = true
}
this.setData({
extendProList: extendProList
})
for (var i in extendProList) {
if (extendProList[i].isSelect) {
proData.push(extendProList[i])
}
}
console.log(proData)
this.setData({
proData: proData
})
},
//全选
allSelect() {
this.setData({
......@@ -64,17 +102,19 @@ Page({
})
if (this.data.isAllSelect) {
this.setData({
cartList: this.data.cartList.map((item) => {
extendProList: this.data.extendProList.map((item) => {
item.isSelect = true
return item
})
}),
proData: this.data.extendProList
})
} else {
this.setData({
cartList: this.data.cartList.map((item) => {
extendProList: this.data.extendProList.map((item) => {
item.isSelect = false
return item
})
}),
proData: []
})
}
},
......@@ -88,15 +128,102 @@ Page({
},
//生成卡片
onTapPoster(){
this.selectComponent('#getPoster').getAvaterInfo()
onTapPoster() {
console.log('----------',this.data.proData)
if (!this.data.proData){
wx.showToast({
title: '请先选择商品',
icon: 'none'
})
return false;
}
let tentacleInfo = {
content: JSON.stringify(this.data.proData),
contentType: 2, //内容类型 1.文章 2.商品 3.页面
title: this.data.proData[0].productName,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
}
this.data.currentShareContent = this.data.proData[0];
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;
this.setData({
showCardModal: true,
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].url,
pagePath: path
});
}
})
},
// 获取推广商品列表
getExtendProList(){
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/merchant/share/productBonus/buyer/findPage?pageNo=${this.data.pageNum}&pageSize=${this.data.pageSize}`,{}).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
extendProList: this.data.pageNum == 1 ? [...data.content] : [...this.data.extendProList, ...data.content],
totalPages: data.totalPages
}, () => {
this.setData({
no_data: this.data.extendProList.length ? true : false
})
})
}
}
})
},
// 获取我的推广订单列表
getMyExtendOrderList(){
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/marketing/tentacleContent/getTentacleContentDTO?pageNum=${this.data.pageNum}&pageSize=${this.data.pageSize}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
let extendData = []
for (var i in data.content){
if (data.content[i].content){
var content = JSON.parse(data.content[i].content)
extendData.push(content)
}
data.content[i].content = extendData
}
this.setData({
myExtendList: this.data.pageNum == 1 ? [...data.content] : [...this.data.myExtendList, ...data.content],
totalPages: res.totalPages
}, () => {
this.setData({
no_data: this.data.orderList.length ? true : false
})
})
}
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getExtendProList()
this.data.currentShareContent = null;
},
/**
......@@ -124,13 +251,55 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.currentTab == 0){
if (this.data.pageNum < this.data.totalPages){
this.setData({
pageNum: this.data.pageNum + 1,
}, () => {
this.getExtendProList()
})
}
}else{
if (this.data.pageNum < this.data.totalPages) {
this.setData({
pageNum: this.data.pageNum + 1,
}, () => {
this.getMyExtendOrderList()
})
}
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (res) {
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 = 'pages/extendProduct/extendProduct?i=' + id + '&t=' + tentacleId;
console.log(path)
return {
path: path
}
}
let tentacleInfo = {
content: this.route,
title: this.route,
contentType: 3,
type: 3// 1:门店,2:员工(暂时不做),3:会员,4:第三方外部渠道,5:智能营销
};
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.tentacleId) {
this.data.currentShareContent.tentacleId = res.tentacleId;
let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `pages/extendProduct/extendProduct?t=${tentacleId}`;
return {
path: path
}
}
});
}
})
\ No newline at end of file
{
"navigationBarTitleText": "推广商品",
"usingComponents": {
"share-modal": "/component/shareModal/shareModal",
"card-modal": "/component/cardModal/cardModal"
}
}
\ No newline at end of file
......@@ -32,28 +32,12 @@
</view>
<view class="buy-product-wrap">
<view class="buy-product-content">
<view class="buy-list">
<view class="buy-list" wx:for="{{extendProList}}" wx:key="{{index}}">
<view class="prod-img">
<image src="/assets/imgs/avatar.png"></image>
</view>
<view class="prod-info">
<view class="prod-name">商品名称商品名称商品名称商品名称商品名称</view>
<view class="hongbao">
<button class="btn btn-primary">预计赚5元红包</button>
</view>
</view>
<view class="select-radio pro-radio" catchtap="selectPro" data-index="{{index}}">
<view class="{{item.isSelect ? 'theme-color' : ''}} circle-radio" >
<image wx:if="{{item.isSelect}}" class="tick-success" src="/assets/imgs/7_1_0/tick-success.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="buy-list">
<view class="prod-img">
<image src="/assets/imgs/avatar.png"></image>
</view>
<view class="prod-info">
<view class="prod-name">商品名称商品名称商品名称商品名称商品名称</view>
<view class="prod-name">{{item.productName}}</view>
<view class="hongbao">
<button class="btn btn-primary">预计赚5元红包</button>
</view>
......@@ -64,6 +48,7 @@
</view>
</view>
</view>
</view>
</view>
<view class="share-wrap">
......@@ -90,10 +75,10 @@
</view>
</view>
<view class="order-content">
<view class="order-list">
<view class="order-list" wx:for="{{myExtendList}}" wx:key="{{index}}" wx:for-item="{{extendItem}}">
<view class="order-header">
<view class="order-number">
<text>时间</text>
<text>{{extendItem.createTime}}</text>
</view>
<text class="order-status">查看收益</text>
</view>
......@@ -115,5 +100,4 @@
</swiper>
</view>
<share-modal show="{{showShareModal}}" />
<share-poster id="getPoster" bindmyevent="myEventListener" avater="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg" codeimg="http://i4.hexun.com/2018-07-05/193365388.jpg" productDesc="1111" userAvatar="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg"></share-poster>
<card-modal show-card-modal="{{showCardModal}}" card-title="{{cardTitle}}" card-url="{{cardUrl}}" page-path="{{pagePath}}"/>
// pages/productDetail/productDetail.js
var app = getApp()
const wxService = require('../../utils/wxService')
import { Integer } from '../../utils/integerDigitalConvertion'
wxService.page({
......
......@@ -22,6 +22,18 @@ wxService.page({
{
mainImgUrl:"http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
amount:0.06
},
{
mainImgUrl: "http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
amount: 0.06
},
{
mainImgUrl: "http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
amount: 0.06
},
{
mainImgUrl: "http://testimg3.bigaka.com/group3/M00/00/17/Cv6CBF1Z9TKAU6T1AAAG8CvHO2o415.png",
amount: 0.06
}
],
},
......
{
"navigationBarTitleText": "plus 购买页"
"navigationBarTitleText": "plus 购买页",
"usingComponents": {
"plus": "/component/plus/plus"
}
}
\ No newline at end of file
......@@ -2,26 +2,7 @@
<view class="plus">
<!-- plus 动态页面 -->
<!-- 底部 -->
<view class="plus-bottom fixed-bottom0 clearfix::after">
<view class="bottom-top">
<view class="pro-list">
<scroll-view scroll-x="true">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{skuVOList}}' wx:for-item="sub" wx:key="s">
<view class="upload_Item item-img" style="background-image:url({{sub.mainImgUrl}})">
<view class="item-mouth">每月仅¥ 25</view>
<view class="item-year">全年卡· 366 天</view>
<view class="item-price">¥ 300</view>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
<view class="bottom-bottom">
<view class="bottom-pay">立即支付 ¥158 </view>
</view>
</view>
</view>
<plus sku-list="{{skuVOList}}"/>
/* subPackage/home/pages/plus/plus.wxss */
@import './../../../../base/base.wxss';
.plus-bottom {
height: 314rpx;
/* background-color: rgba(192, 154, 116, .02); */
background-color: pink;
}
.plus-bottom .bottom-top {
height: 226rpx;
}
.pro-list {
/* height: 155rpx; */
background-color: gray;
margin-left: 20rpx;
/* margin-top: 40rpx; */
box-sizing: border-box;
/* margin: 40rpx 30rpx 0 30rpx; */
}
.item-mouth {
height: 25rpx;
color: rgba(255, 255, 255, 1);
font-size: 18rpx;
}
.item-year {
height: 33rpx;
color: rgba(247, 181, 0, 1);
font-size: 24rpx;
}
.item-price {
height: 50rpx;
color: rgba(245, 248, 250, 1);
font-size: 36rpx;
}
.plus-bottom .bottom-bottom {
width: 100%;
height: 88rpx;
padding-top: 18rpx;
background-color: rgba(255, 255, 255, 1);
}
.bottom-pay {
text-align: center;
width: 280rpx;
line-height: 52rpx;
height: 52rpx;
border-radius: 26px;
background-color: rgba(203, 60, 60, 1);
left: 480px;
color: rgba(255, 255, 255, 1);
font-size: 26rpx;
float: right;
margin-right: 30rpx;
}
.item-img {
background-repeat: no-repeat;
background-size: 100% 100%;
}
.uploadWrap {
/* height: 155rpx; */
height: 100%;
width: 100%;
display: flex;
align-items: center;
display: -webkit-box;
flex-direction: column;
/* margin: 40rpx 30rpx 0 30rpx; */
}
.upload_Item {
width: 209rpx;
height: 155rpx;
flex: 1;
margin: 0rpx 15rpx 15rpx 0;
box-sizing: border-box;
background-color: aqua;
}
.upload_Item:last-child {
margin-right: 20rpx;
}
.upload_Item_img {
width: 209rpx;
height: 155rpx;
}
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