Commit beb84ae0 authored by 黄媛媛's avatar 黄媛媛

111

parent b9439f0f
......@@ -103,7 +103,6 @@ export default {
methods: {
// 购物车
showSkuHandler(g) {
console.log('g', g);
this.sku = g;
this.showSku = true;
},
......
......@@ -94,7 +94,7 @@ export default {
this.active=i
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id });
},
init() {
this.isover = false;
......
<template>
<div class="catstyle4" style="height: 100%;">
<view class="catstyle4" style="height: 100%;">
<div class="left-slider">
<sidebar
:active="tid"
......@@ -57,7 +57,7 @@
</div>
<div class="sell">{{ cx.sales }}</div>
</div>
<div class="right">
<div @click.stop="showSkuHandler(cx)" class="right">
<!-- todo 点击加入购物车-->
<u-icon name="cart-circle-o" size="44" :color="mainColor" />
</div>
......@@ -67,16 +67,16 @@
<u-divider v-if="isover" :margin-top="20" :margin-bottom="20">没有更多商品了</u-divider>
</scroll-view>
</div>
</div>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
</view>
</template>
<script>
import goodSku from '../goods/goodsku';
import sidebar from "../sidebar/index";
export default {
props: ["d", "h"],
components: {
sidebar,
},
data() {
return {
mainColor: "",
......@@ -98,8 +98,13 @@ export default {
OrderBy:1,
UserId:0,
},
sku: {},
showSku: false
};
},
components: {
sidebar,goodSku
},
created() {
this.mainColor = this.$uiConfig.mainColor;
this.activeStyle = `background:${this.mainColor};`;
......@@ -108,6 +113,11 @@ export default {
this.init();
},
methods: {
// 购物车
showSkuHandler(g) {
this.sku = g;
this.showSku = true;
},
changeHandler(i) {
this.msg.CategoryIds= this.d[i].Id+'';
this.msg.page = 1;
......@@ -116,7 +126,7 @@ export default {
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id });
},
init() {
this.isover = false;
......
......@@ -33,7 +33,7 @@
<image
v-if="x.IconPath && x.IconPath.length > 0"
mode="aspectFit"
:src="getIconLink(c.IconPath)"
:src="getIconLink(x.IconPath)"
style="width: 100%; height: 100%;"
/>
</div>
......
......@@ -56,7 +56,7 @@
<view class="price" :style="{ color: mainColor }">{{ cx.price_content }}</view>
<view class="sell">{{ cx.sales }}</view>
</view>
<view class="right">
<view @click.stop="showSkuHandler(cx)" class="right">
<u-icon name="cart-circle-o" size="44" :color="mainColor" />
</view>
</view>
......@@ -71,11 +71,13 @@
</scroll-view>
</view>
</view>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
</view>
</template>
<script>
import sidebar from "../sidebar/index";
import goodSku from '../goods/goodsku';
export default {
props: ["d", "h"],
data() {
......@@ -103,10 +105,12 @@ export default {
CategoryIdsList:[],
CategoryIds1:'',
CategoryIds2:'',
sku: {},
showSku: false
};
},
components: {
sidebar
sidebar,goodSku
},
created() {
this.mainColor = this.$uiConfig.mainColor;
......@@ -123,6 +127,11 @@ export default {
this.init();
},
methods: {
// 购物车
showSkuHandler(g) {
this.sku = g;
this.showSku = true;
},
changeHandler(i) {
this.active=i;
this.CategoryIds1=this.d[i].Id;
......@@ -142,7 +151,7 @@ export default {
this.init();
},
clickHandler(item) {
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.Id });
uni.navigateTo({ url: '/pages/goods/goods?GoodsId='+item.id });
},
init() {
this.CategoryIdsList=[];
......
......@@ -101,13 +101,13 @@ export default {
<style>
.coupon {
min-height: 70vh;
max-height: 70vh;
background: #f5f5f5;
padding-bottom: 50px;
text-align: left !important;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
overflow: hidden;
overflow: scroll;
}
.coupon .title {
font-size: 22px;
......
......@@ -138,6 +138,7 @@ export default {
};
},
mounted() {
console.log("good",this.good)
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsInfo',
......
......@@ -26,14 +26,14 @@
<image :src="y.cover_pic" mode="aspectFill" class="image" />
<view class="goodinfo">
<view class="name">{{ y.name }}</view>
<view class="attr">已选择 {{ y.attrStr }}</view>
<view class="attr">已选择
<span v-for="(item,index) in y.attr_list" :key="index">{{ item.attr_group_name}}:{{ item.attr_name}}</span>
</view>
<view class="price">
<view class="left" :style="{ color: mc }">
<text class="small"></text>
<text>{{ y.goods_attr.price.split(".")[0] }}</text>
<text class="small"
>.{{ y.goods_attr.price.split(".")[1] || "00" }}</text
>
<text>{{ y.goods_attr.price}}</text>
<!-- <text class="small">.{{ y.goods_attr.price.split(".")[1] || "00" }}</text> -->
</view>
<view class="right">x{{ y.num }}</view>
</view>
......
<template>
<view>
<u-popup
close-icon-color="red"
v-model="show"
mode="center"
:mask-close-able="false"
length="auto"
:closeable="true"
close-icon="close"
:border-radius="20"
:z-index="9999"
>
<view style="background:#fff;width:550rpx;padding:40rpx;border-radius:20px">
<u-icon @click="closePay" name="close" style="float:right;font-size:40rpx"></u-icon>
<p style="text-align: center;font-size: 26rpx;">支付方式</p>
<p style="font-size: 36rpx;font-weight: 700;text-align: center;margin:30px 0">支付金额{{ payInfo.total_price }}</p>
<p>
<img style="width:50rpx;height:50rpx;margin-right:10px" src="../../static/wx.png" alt="" />
<span style="position:relative;top:-7px">微信支付</span>
</p>
<view style="margin-top:30px"><u-button @click="Pay" type="error" shape="circle">支付</u-button></view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: ['payInfo'],
data() {
return {
show: true,
orderInfo: {}
};
},
created() {
this.getDataInfo();
},
methods: {
closePay() {
this.$emit('closePay');
},
getDataInfo() {
let msg = {
OpenId: 'ow_7I5XC1-RGwwk8QANBmWKYKmOc',
OrderId: '1',
OrderPayType: 1,
GoodsName: '测试商品名称'
};
this.request2(
{
url: '/api/WeChatPay/GetPayInfo',
data: msg
},
res => {
console.log('res', res);
if (res.resultCode == 1) {
this.orderInfo = JSON.parse(res.data);
}
uni.hideNavigationBarLoading();
}
);
},
Pay() {
let orderInfo = this.orderInfo;
uni.requestPayment({
provider: 'wxpay',
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log('success', res);
uni.navigateTo({
url: '/pages/order-submit/pay-success'
});
},
fail: function(err) {
console.log('fail:', err);
}
});
}
}
};
</script>
<style></style>
......@@ -6,9 +6,9 @@
:enable-flex="true"
:style="{ height: '100%' }"
>
<view v-for="(item, index) in list" :key="index" class="addresbox">
<view v-for="(item, index) in list" :key="index" class="addresbox" @click="chosenHandler(item)">
<view class="addresclo">
<Text >收件人:{{item.Name}}</Text>
<Text>收件人:{{item.Name}}</Text>
<Text>{{item.Mobile}}</Text>
</view>
<Text style='width: 100%;'>收货地址:{{item.DistrictAddress}}{{item.Address}}</Text>
......@@ -24,14 +24,14 @@
<view style="display: flex;flex-direction: row;align-items: center;">
<view
style="display: flex;flex-direction: row;align-items: center;"
@click="btn_edit(item)"
@click.stop="btn_edit(item)"
>
<u-icon name="edit" color="#c8c9cc" size="40"></u-icon>
<Text style="color:#c8c9cc;">编辑</Text>
</view>
<view
style="display: flex;flex-direction: row;align-items: center;margin: 0 30rpx"
@click="btn_delete(item)"
@click.stop="btn_delete(item)"
>
<u-icon name="delete" color="#c8c9cc" size="40"></u-icon>
<Text style="color:#c8c9cc;">删除</Text>
......@@ -84,6 +84,11 @@ export default {
IsDefault:0,
Mobile:'',
},
source: "",
defaultId: 0,
currentAddress: {},
list: [],
mc:"",
};
},
......@@ -110,7 +115,7 @@ export default {
title: this.pageTitle,
});
},
onLoad() {
onLoad(option) {
this.u = wx.getStorageSync("userinfo");
if (!this.u) {
this.u = {
......@@ -119,9 +124,23 @@ export default {
};
this.showAuth = true;
}
if (option && option.form) {
(this.source = option.form), (this.defaultId = option.id);
}
this.init();
},
methods: {
chosenHandler(item){
console.log("chosenHandler",item)
let pages = getCurrentPages()
let prevPage = pages[ pages.length - 2 ]
prevPage.$vm.formData.address_id = item.Id;
prevPage.$vm.formdata.AddressId = item.Id;
prevPage.$vm.adressInfo=item;
uni.navigateBack({
delta: 1
})
},
init() {
this.loading = false;
uni.showNavigationBarLoading();
......
......@@ -5,28 +5,28 @@
<view class="default">
<u-icon name="checked" size="44" :color="mc"></u-icon>
</view>
<view class="address" @click="chosenHandler(currentAddress.id)">
<view class="address" @click="chosenHandler(currentAddress)">
<view class="base">
<text class="name">{{currentAddress.name}}</text>
<text class="phone">{{currentAddress.mobile}}</text>
<text class="name">{{currentAddress.Name}}</text>
<text class="phone">{{currentAddress.Mobile}}</text>
</view>
<view class="details">
{{currentAddress.address}}
{{currentAddress.Address}}
</view>
</view>
<view class="edit">
<view @click.stop="btn_edit(currentAddress)" class="edit">
<u-icon name="edit" size="44" color="#444"></u-icon>
</view>
</view>
<view class="item" v-for="(x, i) in list" :key="i">
<view class="address">
<view class="base" @click="chosenHandler(x.id)">
<text class="name">{{x.name}}</text>
<text class="phone">{{x.mobile}}</text>
<view class="base" @click="chosenHandler(x)">
<text class="name">{{x.Name}}</text>
<text class="phone">{{x.Mobile}}</text>
</view>
<view class="details">{{x.address}}</view>
<view class="details">{{x.Address}}</view>
</view>
<view class="edit">
<view @click.stop="btn_edit(x)" class="edit">
<u-icon name="edit" size="44" color="#444"></u-icon>
</view>
</view>
......@@ -59,11 +59,17 @@ export default {
defaultId: 0,
currentAddress: {},
list: [],
mc:""
mc:"",
msg:{
Name:'',
IsDefault:0,
Mobile:'',
},
};
},
onLoad(option) {
if (option.form) {
console.log("option",option)
if (option && option.form) {
(this.source = option.form), (this.defaultId = option.id);
}
this.mc = this.$uiConfig.mainColor;
......@@ -71,48 +77,85 @@ export default {
this.init();
},
methods: {
chosenHandler(id){
btn_edit(item) {
console.log("item",item)
uni.navigateTo({
url: "/pages/address/AddAddress?AddressId="+item.Id
});
},
chosenHandler(item){
let pages = getCurrentPages()
let prevPage = pages[ pages.length - 2 ]
prevPage.$vm.formData.address_id = id
prevPage.$vm.formData.address_id = item.Id;
prevPage.$vm.formdata.AddressId = item.Id;
prevPage.$vm.adressInfo=item;
uni.navigateBack({
delta: 1
})
},
newAddressHandler(){
console.log("hhhh")
uni.navigateTo({
url: '/pages/address/addAddress'
url: '/pages/address/AddAddress'
});
},
init() {
console.log("1111")
this.loading = false;
let h=this.apiheader()
this.request(
{
url: "",
header: h,
data: {
r: "api/user/address",
},
},
this.request2(
{
url: '/api/AppletUser/GetUserShippingAddressList',
data: this.msg
},
res => {
uni.hideNavigationBarLoading();
console.log("res",res)
if(res.resultCode==1){
this.isloading = false;
this.list = res.data;
let index = -1;
this.list.forEach((x, i) => {
x.MobileNew = x.Mobile;
x.Mobile = x.Mobile.substr(0, 3) + "****" + x.Mobile.substr(7);
if (x.Id == this.defaultId) {
this.currentAddress = x;
index = i;
}
});
if (index != -1) {
this.list.splice(index, 1);
}
}
}
);
// let h=this.apiheader()
// this.request(
// {
// url: "",
// header: h,
// data: {
// r: "api/user/address",
// },
// },
(res) => {
uni.hideNavigationBarLoading();
this.isloading = false;
this.list = res.data.list;
let index = -1;
this.list.forEach((x, i) => {
x.mobile = x.mobile.substr(0, 3) + "****" + x.mobile.substr(7);
if (x.id == this.defaultId) {
this.currentAddress = x;
index = i;
}
});
if (index != -1) {
this.list.splice(index, 1);
}
}
);
// (res) => {
// uni.hideNavigationBarLoading();
// this.isloading = false;
// this.list = res.data.list;
// let index = -1;
// this.list.forEach((x, i) => {
// x.mobile = x.mobile.substr(0, 3) + "****" + x.mobile.substr(7);
// if (x.id == this.defaultId) {
// this.currentAddress = x;
// index = i;
// }
// });
// if (index != -1) {
// this.list.splice(index, 1);
// }
// }
// );
},
},
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -167,7 +167,7 @@ export default {
this.showLoading = this.msg.pageIndex != 1;
this.request2(
{
url: '/api/AppletGoods/GetAppletGoodsPageList',
url: '/api/AppletGoods/GetAppletGoodsPageListForZY',
data: this.msg
},
res => {
......
This diff is collapsed.
<template>
<view>
<u-button @click="Pay">支付</u-button>
</view>
</template>
<script>
export default {
data() {
return {
payInfo:{},
}
},
created(){
this.getDataInfo();
},
methods: {
getDataInfo() {
let msg={
"OpenId":"ow_7I5XC1-RGwwk8QANBmWKYKmOc",
"OrderId":"1",
"OrderPayType":1,
"GoodsName":"测试商品名称"
}
this.request2(
{
url: '/api/WeChatPay/GetPayInfo',
data: msg
},
res => {
console.log("res",res);
if(res.resultCode==1){
this.payInfo=JSON.parse(res.data);
console.log("getDataInfo",this.payInfo);
}
uni.hideNavigationBarLoading();
}
);
},
Pay(){
let payInfo=this.payInfo;
uni.requestPayment({
provider: 'wxpay',
timeStamp: this.payInfo.timeStamp,
nonceStr: this.payInfo.nonceStr,
package: this.payInfo.package,
signType: this.payInfo.signType,
paySign: this.payInfo.sign,
success: function (res) {
console.log("success",res)
},
fail: function (err) {
console.log('fail:',err);
}
});
},
}
}
</script>
<style>
</style>
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