Browse Source

添加商品详情页,海报页

wangxin 6 years ago
parent
commit
245a71199a

+ 4 - 3
app.json

@@ -1,10 +1,11 @@
 {
   "pages": [
+    "template/carts/index",
+    "template/poster/index",
+    "template/view/index",
     "template/home/index",
     "template/pay/index",
-    "template/carts/index",
-    "template/login/index",
-    "template/view/index"
+    "template/login/index"
   ],
   "window": {
     "navigationBarTextStyle": "#fff",

+ 15 - 0
template/carts/index.js

@@ -25,6 +25,21 @@ Page({
     //test - end
   },
 
+  /**
+   * 删除订单
+   */
+  delOrder: function(e){
+    var that = this;
+    wx.showModal({
+      content: '确定删除该订单吗?',
+      success: function(res){
+        if (res.confirm){
+          that.dever.alert('订单删除成功!');
+        }
+      }
+    })
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 1 - 1
template/carts/index.wxml

@@ -3,7 +3,7 @@
     <text class='tips'>填写收货地址</text>
     <button class='nxh__button' bindtap='useWxAddress'>使用微信地址</button>
   </view>
-  <view class='order' wx:for='{{list}}' wx:key='{{index}}'>
+  <view class='order' wx:for='{{list}}' wx:key='{{index}}' bindlongtap='delOrder'>
     <text class='title'>{{item.name}}</text>
     <view class='oper'>
       <text class='price'>¥ {{item.price}}</text>

+ 0 - 1
template/home/index.wxss

@@ -35,7 +35,6 @@
 
 .nxh__button
 {
-  display: flex;
   width: 180rpx;
 }
 .cash {

+ 65 - 0
template/poster/index.js

@@ -0,0 +1,65 @@
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+    
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+    
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    
+  }
+})

+ 3 - 0
template/poster/index.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "农小盒"
+}

+ 7 - 0
template/poster/index.wxml

@@ -0,0 +1,7 @@
+<view class='content'>
+  <image mode='widthFix' src='/static/img/item-1.png'></image>
+</view>
+<view class='bottom'>
+  <button class='nxh__button nxh__button2'>保存海报分享朋友圈</button>
+  <button class='nxh__button'>转发分享给朋友</button>
+</view>

+ 17 - 0
template/poster/index.wxss

@@ -0,0 +1,17 @@
+.content image {
+  width: 750rpx;
+}
+.bottom {
+  position: fixed;
+  bottom: 70rpx;
+  width: 750rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+.nxh__button2 {
+  margin-bottom: 30rpx;
+  background: #fff;
+  border:1rpx solid #539804;
+  color: #539804;
+}

+ 1 - 2
template/view/index.js

@@ -1,11 +1,10 @@
-// template/view/index.js
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-  
+    
   },
 
   /**

+ 7 - 2
template/view/index.wxml

@@ -1,2 +1,7 @@
-<!--template/view/index.wxml-->
-<text>template/view/index.wxml</text>
+<view class='content'>
+  <image mode='widthFix' src='/static/img/item-1.png'></image>
+</view>
+<view class='bottom'>
+  <button class='nxh__button'>分享给好友</button>
+  <button class='nxh__button'>立即购买</button>
+</view>

+ 14 - 1
template/view/index.wxss

@@ -1 +1,14 @@
-/* template/view/index.wxss */
+.content image {
+  width: 750rpx;
+}
+.bottom {
+  position: fixed;
+  bottom: 30rpx;
+  width: 750rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+.nxh__button {
+  width:280rpx;
+}