Commit 7a09b3c7 authored by 华国豪's avatar 华国豪 🙄

1

parent b4b73154
......@@ -3,7 +3,7 @@ let md5 = require('utils/md5.js')
let javaUrl = 'https://efficient.oytour.com/';
// let javaUrl = 'http://47.96.12.235:9001/';
// let netUrl = 'https://reborn.oytour.com/api/common/post';
let netUrl = 'http://192.168.2.65:8025/api/Common/Post';
let netUrl = 'http://192.168.2.16:8083/api/Common/Post';
App({
// 小程序初始化时
onLaunch: function(options) {
......@@ -62,16 +62,15 @@ App({
msg: data,
timestamp: timestamp,
token: getApp().state.admin.token,
sign: sign
sign: sign,
uid: 5
},
success(res) {
wx.hideLoading()
if (res.data.resultCode === 1) {
resolve(res.data.data);
} else if (res.data.resultCode === 10000 || res.data.resultCode === 10001) {
wx.navigateTo({
url: '/pages/login/login'
})
} else {
wx.showToast({
title: res.data.message,
......
......@@ -3,7 +3,8 @@
"pages/Home/home",
"pages/Product/ProductDetails/ProductDetails",
"pages/Product/classify/classify",
"pages/mine/mine"
"pages/mine/mine",
"pages/ShoppingCart/ShoppingCart"
],
"permission": {
"scope.userLocation": {
......@@ -36,7 +37,7 @@
"text": "分类"
},
{
"pagePath": "pages/Home/home",
"pagePath": "pages/ShoppingCart/ShoppingCart",
"iconPath": "images/tarbar/gouwuche.png",
"selectedIconPath": "images/tarbar/gouwuche1.png",
"text": "购物车"
......
/**app.wxss**/
@import "weui.wxss";
@import '/pages/wxParse/wxParse.wxss';
@import 'Common.wxss';
view,scroll-view,swiper,swiper-item,movable-area,movable-view,cover-view,cover-image,icon,text,rich-text,progress,button,checkbox-group,checkbox,form,input,label,picker,picker-view,radio-group,radio,slider,switch,textarea,navigator,functional-page-navigator,image,video,camera,live-player,live-pusher,map,canvas,open-data,web-view,ad{
......
......@@ -11,8 +11,78 @@ Page({
autoplay: true,
circular: true,
interval: 2000,
duration: 500
duration: 500,
typeList: [],
newList: [],
hotList: [],
},
getNewList: function (){
app.$api('Shop_post_GetPageList', {
pageSize: 50,
pageIndex: 1,
SellType: 2,
Status: 3,
OrderBy: 1,
OrderType: 2
}).then(res => {
console.log(res)
let list = res.pageData
this.setData(
{
newList: list
}
)
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
getHotList: function () {
app.$api('Shop_post_GetPageList', {
pageSize: 50,
pageIndex: 1,
Status: 3,
OrderBy: 1,
OrderType: 2,
ListType: 1,
}).then(res => {
console.log(res)
let list = res.pageData
this.setData(
{
hotList: list
}
)
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
getTypeList: function (){
app.$api('Shop_post_GetCommodityCategoryPageList', {
pageIndex: 1,
pageSize: 10,
Name: "",
ParentId: 0
}).then(res => {
let typeList = res.pageData
this.setData({
typeList: typeList
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
goDerails: function(e){
console.log(e)
let id = e.currentTarget.dataset.id
......@@ -39,6 +109,9 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getTypeList()
this.getNewList()
this.getHotList()
},
/**
......
......@@ -18,29 +18,11 @@
</view>
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%">
<view class="top-fenlei">
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">美妆个护</view>
</view>
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">母婴</view>
</view>
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">营养保健</view>
</view>
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">进口食品</view>
</view>
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">生鲜肉类</view>
</view>
<view class="top-fenlei-item">
<view class="img">图片</view>
<view class="f22 c00">水果蔬菜</view>
<view class="top-fenlei-item" wx:for="{{typeList}}" wx:key="index">
<view class="img">
<image src="{{item.Image}}"></image>
</view>
<view class="f22 c00">{{item.Name}}</view>
</view>
</view>
</scroll-view>
......@@ -49,52 +31,12 @@
</view>
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%">
<view class="new-pro">
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo.png"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
</view>
</view>
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo2.jpg"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
</view>
</view>
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo3.jpg"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
</view>
</view>
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo4.jpg"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
</view>
</view>
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo.png"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
</view>
</view>
<view class="new-pro-item">
<view class="img"><image mode="scaleToFill" src="/images/home/demo2.jpg"></image></view>
<view class="f26 c00 text2 bold">日本进口 三立(Sanritsu) 德国进口啊啊哈哈</view>
<view class="new-pro-item" wx:for="{{newList}}" wx:key="index" data-id="{{item.Id}}" bindtap="goDerails">
<view class="img"><image mode="scaleToFill" src="{{item.FlowImgList[0]}}"></image></view>
<view class="f26 c00 text2 bold" style="min-height: 84rpx;">{{item.Name}}</view>
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
<text class="f28 bold">{{item.SellPrice}}</text>
</view>
</view>
</view>
......@@ -103,18 +45,18 @@
<image mode="widthFix" src="/images/home/chaozhi.png"></image>
</view>
<view class="zhi-pro">
<view class="zhi-pro-item" wx:for="{{6}}" wx:key="*this" data-id="{{6}}" bindtap="goDerails">
<view class="zhi-pro-item" wx:for="{{hotList}}" wx:key="index" data-id="{{item.Id}}" bindtap="goDerails">
<view class="zhi-pro-item-box">
<view>
<image src="/images/home/demo2.jpg"></image>
<image src="{{item.FlowImgList[0]}}"></image>
</view>
<view class="zhi-pro-item-info">
<view class="text1 f26 bold">日本进口 嘉娜宝(Kracie)香体糖 玫瑰\(Kracie)香体玫瑰玫瑰玫瑰</view>
<view class="text1 f22 c66 sub-tit">日本进口 嘉娜宝(Kracie)香体糖 玫瑰\(Kracie)香体KracieKracie香体玫瑰玫瑰玫瑰</view>
<view class="text1 f26 bold">{{item.Name}}</view>
<view class="text1 f22 c66 sub-tit">{{item.Description}}</view>
<view class="zhi-pro-item-price">
<view class="price cee">
<text class="f22">¥</text>
<text class="f28 bold">29.9</text>
<text class="f28 bold">{{item.SellPrice}}</text>
</view>
<view class="gouwuche">
<image src="/images/tarbar/gouwuche1.png"></image>
......
......@@ -95,6 +95,9 @@
height: 180rpx;
margin-right: 20rpx;
}
.zhi-pro-item-info{
flex: 2;
}
.zhi-pro-item-info .sub-tit{
margin: 19rpx 0 56rpx 0;
}
......
// pages/Product/ProductDetails/ProductDetails.js
let app = getApp();
var WxParse = require('../../wxParse/wxParse.js');
Page({
/**
......@@ -11,7 +12,32 @@ Page({
circular: true,
interval: 2000,
duration: 500,
currentIndex: 1
currentIndex: 1,
number: 1,
taocanBoxShow: false,
details: {}
},
setBoxShow: function (e) {
this.setData({
[e.currentTarget.dataset.name]: !this.data[e.currentTarget.dataset.name]
})
},
regNumber: function (e){
this.setData({
number: e.detail.value * 1
})
},
calculation: function (e) {
let type = e.currentTarget.dataset.type
if (type == 1) {
this.setData({
number: this.data.number === 1 ? 1 : this.data.number - 1
})
} else {
this.setData({
number: this.data.number + 1
})
}
},
bindanimationfinish: function (e){
let index = e.detail.current
......@@ -19,11 +45,30 @@ Page({
currentIndex: index + 1
})
},
init: function (id){
app.$api('Shop_post_GetCommodityInfo', {
CommodityId: id
}).then(res => {
console.log(res)
WxParse.wxParse('Content', 'html', res.Content, this, 0);
this.setData({
details: res
})
}).catch(err => {
wx.showToast({
title: err.message,
icon: 'none',
duration: 2000
})
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
let id = options.id
this.init(id)
},
/**
......
<import src='../../wxParse/wxParse.wxml' />
<view class="ProductDetails commonF">
<scroll-view class="conten-scroll-view" scroll-y>
<view class="page-section page-section-spacing swiper">
<swiper
bindanimationfinish="bindanimationfinish"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{background}}" wx:key="*this">
<block wx:for="{{details.FlowImgList}}" wx:key="{{index}}">
<swiper-item>
<view class="swiper-item {{item}}"></view>
<image src="{{item}}"></image>
</swiper-item>
</block>
</swiper>
......@@ -14,7 +15,7 @@
<image src="/images/product/zheng.png"></image><text class="f24 cff">代购自营 日本直采</text>
</view>
<view class="img-page f26">
<text>{{currentIndex}}</text>/<text>{{background.length}}</text>
<text>{{currentIndex}}</text>/<text>{{details.FlowImgList.length}}</text>
</view>
</view>
<view class="product-info">
......@@ -25,12 +26,12 @@
<image src="/images/product/beizhu.png"></image>
</view>
<view class="product-tit f32 c11">
Kao花王旗下ClearClean洁齿健防蛀护齿牙垢白牙膏165克/支
{{details.Name}}
</view>
<view class="product-tits f24 c66">
防蛀小能手,花王防蛀护齿除牙垢白牙膏,有效成分能够抗感防蛀,给口腔更深入的清洁,牙齿健康
{{details.Description}}
</view>
<view class="f22 c11 product-tag">
<!-- <view class="f22 c11 product-tag">
<view>
<image src="/images/product/feiji1.png"></image>
<text>日本直邮</text>
......@@ -43,10 +44,10 @@
<image src="/images/product/tui.png"></image>
<text>30天无忧退货</text>
</view>
</view>
</view> -->
</view>
<view class="Gray30"></view>
<view class="peisong other-info">
<!-- <view class="peisong other-info">
<text class="f24 c88 left-name">配送</text>
<view class="flex2 f24 c11 bb1e9 padr30">
<view class="other-info-addr">
......@@ -74,8 +75,8 @@
</view>
</view>
</view>
</view>
<view class="peisong other-info">
</view> -->
<!-- <view class="peisong other-info" bindtap="setBoxShow" data-name="taocanBoxShow">
<text class="f24 c88 left-name">已选</text>
<view class="flex2 f24 c11 bb1e9 padr30">
<view class="other-info-addr padb30">
......@@ -83,8 +84,8 @@
<image src="/images/product/right.png"></image>
</view>
</view>
</view>
<view class="peisong other-info">
</view> -->
<!-- <view class="peisong other-info">
<text class="f24 c88 left-name">参数</text>
<view class="flex2 f24 c11 bb1e9 padr30">
<view class="other-info-addr padb30">
......@@ -92,18 +93,18 @@
<image src="/images/product/right.png"></image>
</view>
</view>
</view>
</view> -->
<view class="peisong other-info">
<text class="f24 c88 left-name">说明</text>
<view class="flex2 f24 c11 padr30">
<view class="other-info-addr padb30">
<view class="text1">日本直邮 | 正品保证 | 30天无忧退货 | 满99包邮</view>
<view class="text1"><text wx:for="{{details.ExplainStrList}}" wx:key="index">{{item}}<text wx:if="{{index!==details.ExplainStrList.length-1}}"> | </text></text></view>
<image src="/images/product/right.png"></image>
</view>
</view>
</view>
<view class="Gray30"></view>
<view class="tuijian">
<view class="tuijian" wx:if="{{false}}">
<view class="f26 c11 tuijian-tit">看了这件商品的人也看了</view>
<scroll-view class="scroll-view_H" scroll-x="true" style="width: 100%">
<view class="new-pro">
......@@ -158,32 +159,12 @@
</view>
</scroll-view>
</view>
<view class="Gray30"></view>
<view class="Gray30 f22 c33"></view>
<view class="pro-det">
<view class="pro-det-tit f26 c11">图文详情</view>
<image mode="widthFix" class="pro-img" src="http://imgfile.oytour.com/Upload/Editor/2019/9/20190910051749947.jpg"></image>
<image mode="widthFix" class="pro-img" src="http://imgfile.oytour.com/Upload/Editor/2019/9/20190910051753452.jpg"></image>
<image mode="widthFix" class="pro-img" src="http://imgfile.oytour.com/Upload/Editor/2019/9/20190910051757894.jpg"></image>
<image mode="widthFix" class="pro-img" src="http://imgfile.oytour.com/Upload/Editor/2019/9/20190910051801793.jpg"></image>
<image mode="widthFix" class="pro-img" src="http://imgfile.oytour.com/Upload/Editor/2019/9/20190910051805542.jpg"></image>
<template is="wxParse" data="{{wxParseData:Content.nodes}}" />
</view>
<view class="pro-det">
<view class="pro-det-tit f26 c11">包装与生产日期</view>
<view class="f22 c33">因跨境商品经常更换包装和附件,可能存在页面更新不及时的情况,敬
请谅解!详情页里的商品参数、图片、功能、及附件仅供参考,具体请
您以收到的实物为准。
跨境商品包装上一般不会单独标识保质期期限,通常只在产品包装上标
注生产日期或有效日期,也存在只标注出厂批号的情况:比如日本的洗
护品,化妆品(有些品牌可以根据批号读取日期,在此不做一一列举)
。另部分商品喷印的日期,在运输过程中因为摩擦碰撞很容易糊掉或碰
掉,属正常现象。请谅解并请您放心,海购销售的跨境商品都是符合原
产地规定的合格产品。
跨境食品一般表示"Best before date",即最佳赏味日期。该日期不是"
最终保质期",意为在此日期前食用能保证食物新鲜,故在"最佳赏味日
期"前食用风味更佳。
</view>
</view>
<view class="pro-det">
<!-- <view class="pro-det">
<view class="pro-det-tit f26 c11">价格说明</view>
<view class="f22 c33">因跨境商品经常更换包装和附件,可能存在页面更新不及时的情况,敬
请谅解!详情页里的商品参数、图片、功能、及附件仅供参考,具体请
......@@ -196,7 +177,7 @@
请谅解!详情页里的商品参数、图片、功能、及附件仅供参考,具体请
您以收到的实物为准。
</view>
</view>
</view> -->
<view class="white30"></view>
</scroll-view>
<view class="PayView">
......@@ -219,4 +200,29 @@
<view class="goumai">立即购买</view>
</view>
</view>
<view class="taocan-box" wx:if="{{taocanBoxShow}}" bindtap="setBoxShow" data-name="taocanBoxShow">
<view class="taocan-content" catchtap>
<view class="taocan-tit">
<text class="f30 c11">选择套餐</text>
<image src="/images/product/close.png" bindtap="setBoxShow" data-name="taocanBoxShow"></image>
</view>
<view class="taocan-type-box f22 bb1e9">
<view class="taocan-type-item active">防蛀护齿薄荷味牙膏</view>
<view class="taocan-type-item">草莓味牙膏</view>
<view class="taocan-type-item">哈密瓜味牙膏</view>
<view class="taocan-type-item">哈密瓜味牙膏</view>
</view>
<view class="taocan-number">
<view class="f24 c11">购买数量</view>
<view class="taocan-count">
<text class="bold f30" bindtap="calculation" data-type="1">-</text>
<input type="number" value="{{number}}" bindinput="regNumber"></input>
<text class="bold f30" bindtap="calculation" data-type="2">+</text>
</view>
</view>
<view class="quer-btn f30 cff center" bindtap="setBoxShow" data-name="taocanBoxShow">
确定
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -201,4 +201,74 @@
}
.goumai{
background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1));
}
.taocan-box{
height: calc(100vh);
width: 100%;
background:rgba(0,0,0,.5);
position: fixed;
left: 0;
top: 0;
z-index: 5;
}
.taocan-content{
position: absolute;
left: 0;
bottom: 0;
background-color: white;
padding: 30rpx;
width: 100%;
border-radius: 12rpx 12rpx 0px 0px;
}
.taocan-tit{
text-align: center;
padding-bottom: 60rpx;
}
.taocan-tit image{
width: 30rpx;
height: 30rpx;
position: absolute;
right: 30rpx;
top: 30rpx;
}
.taocan-type-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.taocan-type-box .taocan-type-item{
padding: 15rpx 17rpx;
margin-bottom: 30rpx;
background:rgba(244,244,244,1);
border-radius:25px;
border:1px solid rgba(226, 20, 54, 0);
}
.taocan-type-box .taocan-type-item.active{
background:rgba(255,223,226,1);
border:1px solid rgba(226, 20, 54, 1);
color: #E21436;
}
.taocan-number{
display: flex;
justify-content: space-between;
padding: 30rpx 0;
}
.taocan-count{
display: flex;
justify-content: center;
align-items: center;
}
.taocan-count text {
padding: 0 20rpx;
}
.taocan-count input{
width: 80rpx;
padding: 0 10rpx;
text-align: center;
}
.quer-btn{
margin: 0 15rpx;
padding: 23rpx;
background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1));
border-radius:37px;
}
\ No newline at end of file
......@@ -51,5 +51,7 @@
.img-box{
height: 140rpx;
width: 100%;
line-height: 200rpx;
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file
......@@ -32,6 +32,8 @@
"hidedInDevtools": []
},
"scripts": {},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
......@@ -75,6 +77,12 @@
"pathName": "pages/mine/mine",
"query": "",
"scene": null
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/ShoppingCart/ShoppingCart",
"scene": null
}
]
}
......
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