首页修改
This commit is contained in:
parent
20f05cc4c9
commit
4dee28c5ab
|
@ -11,10 +11,10 @@ Page({
|
|||
var self = this;
|
||||
// 获取地址信息
|
||||
wx.request({
|
||||
url: 'http://localhost:8080/getAddress',
|
||||
method: 'POST',
|
||||
url: 'http://localhost:8080/user/getById',
|
||||
method: 'GET',
|
||||
data: {
|
||||
|
||||
id:1
|
||||
},
|
||||
success(res) {
|
||||
self.setData({
|
||||
|
@ -36,9 +36,10 @@ Page({
|
|||
if (value.name && value.phone && value.detail){
|
||||
//保存地址
|
||||
wx.request({
|
||||
url: 'http://localhost:8080/addAdress',
|
||||
url: 'http://localhost:8080/user/addOrUpdate',
|
||||
method: 'POST',
|
||||
data: {
|
||||
id: value.id,
|
||||
name : value.name,
|
||||
phone: value.phone,
|
||||
address: value.detail
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<view class="goods-box">
|
||||
<!-- <image src="{{goods.image}}" class="goods-thumb"></image> -->
|
||||
<swiper class="banner" indicator-dots="true" autoplay="true" interval="{{interval}}" duration="{{duration}}" circular="true">
|
||||
<block wx:for="{{goods.image}}" wx:key="{{index}}">
|
||||
<block wx:for="{{goods.goodImage}}" wx:key="{{index}}">
|
||||
<swiper-item>
|
||||
<image src="{{item}}" class="slide-image" width="100%" />
|
||||
</swiper-item>
|
||||
|
@ -27,15 +27,15 @@
|
|||
</view>
|
||||
<image wx:if="{{show}}" src="/image/cart1.png" class="to-carts-icon"></image>
|
||||
<!-- <view class="goods-stock">{{goods.stock}}</view> -->
|
||||
<view class="goods-title">{{goods.title}}</view>
|
||||
<view class="goods-price">¥ {{goods.price}}</view>
|
||||
<view class="goods-title">{{goods.goodName}}</view>
|
||||
<view class="goods-price">¥ {{goods.goodPrice}}</view>
|
||||
</view>
|
||||
<view class="goods-tab-box">
|
||||
<view class="goods-tab-nav {{curIndex === 0 ?'on':''}}" bindtap="bindTap" data-index="0">商品详情</view>
|
||||
<view class="goods-tab-nav {{curIndex === 1 ?'on':''}}" bindtap="bindTap" data-index="1">产品参数</view>
|
||||
<view class="goods-tab-nav {{curIndex === 2 ?'on':''}}" bindtap="bindTap" data-index="2">售后保障</view>
|
||||
<view class="goods-content">
|
||||
<view wx:if="{{curIndex === 0}}">{{goods.detail}}</view>
|
||||
<view wx:if="{{curIndex === 0}}">{{goods.goodDetail}}</view>
|
||||
<view wx:if="{{curIndex === 1}}">{{goods.parameter}}</view>
|
||||
<view wx:if="{{curIndex === 2}}">{{goods.service}}</view>
|
||||
</view>
|
||||
|
|
|
@ -27,11 +27,12 @@ Page({
|
|||
*/
|
||||
wx.request({
|
||||
// get请求
|
||||
url: 'http://localhost:8080/getGoods',
|
||||
url: 'http://localhost:8080/goods/loadData',
|
||||
success(res) {
|
||||
self.setData({
|
||||
goods: res.data
|
||||
goods: res.data.data
|
||||
})
|
||||
console.log(res,'res',res.data.data)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
|
@ -38,9 +38,14 @@
|
|||
<view class="newest-title"><text>大雄出品</text></view>
|
||||
<view class="newest-box">
|
||||
<view class="newest-list">
|
||||
<navigator url="details/details?id={{goods.id}}&image={{goods.image}}&title={{goods.title}}&price={{goods.price}}&detail={{goods.detail}}">
|
||||
<image src="{{goods.image[0]}}"></image>
|
||||
<view class="newest-text"><text>{{goods.title}} {{goods.price}}¥</text></view>
|
||||
<navigator url="details/details?id={{goods.id}}&image={{goods.goodImage}}&title={{goods.goodName}}&price={{goods.goodPrice}}&detail={{goods.goodDetail}}">
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{goods}}" wx:key="id">
|
||||
<image src="{{item.goodImage}}"></image>
|
||||
<view class="newest-text"><text>{{item.goodName}} {{item.goodPrice}}¥</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="newest-text"><text></text></view> -->
|
||||
</navigator>
|
||||
</view>
|
||||
|
|
|
@ -18,7 +18,7 @@ Page({
|
|||
var self = this;
|
||||
// 获取地址信息
|
||||
wx.request({
|
||||
url: 'http://localhost:8080/getOrders',
|
||||
url: 'http://localhost:8080/order/loadData',
|
||||
method: 'POST',
|
||||
data: {
|
||||
|
||||
|
|
Loading…
Reference in New Issue