pplok #22
1
app.json
1
app.json
@ -1,6 +1,7 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/login/login",
|
||||
"pages/search/search",
|
||||
"pages/shopping/shopping",
|
||||
"pages/classify/classify",
|
||||
|
16
app.wxss
16
app.wxss
@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
@ -8,7 +10,7 @@
|
||||
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
html {
|
||||
line-height: 1; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
@ -174,7 +176,8 @@ textarea {
|
||||
*/
|
||||
|
||||
button,
|
||||
input { /* 1 */
|
||||
input {
|
||||
/* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
@ -184,7 +187,8 @@ input { /* 1 */
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
select {
|
||||
/* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
@ -347,7 +351,7 @@ template {
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
image{
|
||||
image {
|
||||
background-size: cover;
|
||||
background-image: url('http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg');
|
||||
}
|
||||
background-image: url("http://luyuan.tk/static/images/TIM%E5%9B%BE%E7%89%8720191214113605.jpg");
|
||||
}
|
||||
|
@ -2,7 +2,14 @@ Component({
|
||||
properties: {
|
||||
},
|
||||
data: {
|
||||
id:0
|
||||
},
|
||||
methods: {
|
||||
select(a){
|
||||
// console.log(a.target.dataset.id)
|
||||
this.setData({
|
||||
id:a.target.dataset.id
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
@ -1,10 +1,10 @@
|
||||
<scroll-view class="navigation" scroll-y="{{true}}" >
|
||||
<view class="on">热门商品</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<view>美容健身</view>
|
||||
<scroll-view class="navigation" scroll-y="{{true}}" bind:tap="select" >
|
||||
<view data-id="0" class="{{id == 0?'on' : ''}}">热门商品</view>
|
||||
<view data-id="1" class="{{id == 1?'on' : ''}}">美容健身</view>
|
||||
<view data-id="2" class="{{id == 2?'on' : ''}}">美容健身</view>
|
||||
<view data-id="3" class="{{id == 3?'on' : ''}}">美容健身</view>
|
||||
<view data-id="4" class="{{id == 4?'on' : ''}}">美容健身</view>
|
||||
<view data-id="5" class="{{id == 5?'on' : ''}}">美容健身</view>
|
||||
<view data-id="6" class="{{id == 6?'on' : ''}}">美容健身</view>
|
||||
<view data-id="7" class="{{id == 7?'on' : ''}}">美容健身</view>
|
||||
</scroll-view>
|
@ -1,5 +1,10 @@
|
||||
Component({
|
||||
properties: {},
|
||||
properties: {
|
||||
img:String,
|
||||
title:String,
|
||||
id:String,
|
||||
price:String
|
||||
},
|
||||
data: {},
|
||||
methods: {
|
||||
gotodetail() {
|
||||
|
@ -25,12 +25,22 @@
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
margin-bottom: 22rpx;
|
||||
overflow: hidden;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
display: -webkit-box;
|
||||
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
> view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
> text:first-child {
|
||||
|
||||
font-size: 30rpx;
|
||||
color: #dec499;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<view class="commodity" bindtap="gotodetail">
|
||||
<view class="content">
|
||||
<image class="imgthumb "></image>
|
||||
<image class="imgthumb " src="{{img}}"></image>
|
||||
<view class="introduce">
|
||||
<text>产品名称产品名称产品名称产品名称产品名称产品名称产品名称</text>
|
||||
<text class="towline">{{title}}</text>
|
||||
<view>
|
||||
<text>¥657</text>
|
||||
<text>¥{{price}}</text>
|
||||
<text>加入购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1 +1 @@
|
||||
.commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e}
|
||||
.commodity{width:623rpx;height:143rpx;margin-top:32rpx;display:flex;align-items:center}.commodity .content{width:614rpx;height:100%;display:flex;align-items:center;box-shadow:0 0 24rpx 0 rgba(227,227,227,0.4)}.commodity .content .imgthumb{width:105rpx;height:105rpx;margin-left:40rpx;background-color:#333}.commodity .content .introduce{width:410rpx;margin-left:40rpx;display:flex;flex-direction:column}.commodity .content .introduce>text{font-size:26rpx;color:#333;margin-bottom:22rpx;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.commodity .content .introduce>view{display:flex;align-items:center;justify-content:space-between}.commodity .content .introduce>view>text:first-child{font-size:30rpx;color:#dec499}.commodity .content .introduce>view>text:last-child{font-size:22rpx;color:#999}.commodity .decorate{width:9rpx;height:102rpx;background-color:#3fb66e}
|
||||
|
@ -1,5 +1,6 @@
|
||||
Component({
|
||||
properties: {
|
||||
list:Array
|
||||
},
|
||||
data: {
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
<view class="list">
|
||||
<text class="title">热门商品</text>
|
||||
<commodity></commodity>
|
||||
<commodity wx:for="{{list}}" title="{{item.goods_name}}" price="{{item.shop_price}}" img="{{item.image}}"></commodity>
|
||||
</view>
|
@ -14,13 +14,28 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
num: 5
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
rm() {
|
||||
if (this.data.num == 0) {
|
||||
return
|
||||
} else {
|
||||
this.setData({
|
||||
num: this.data.num - 1
|
||||
})
|
||||
}
|
||||
},
|
||||
add() {
|
||||
|
||||
this.setData({
|
||||
num: this.data.num + 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
@ -9,8 +9,8 @@
|
||||
<view class="price">${{price}}</view>
|
||||
</view>
|
||||
<view class="numberset">
|
||||
<view class="reverse"></view>
|
||||
<view class="num">5</view>
|
||||
<view class="add"></view>
|
||||
<view class="reverse" bind:tap="rm">-</view>
|
||||
<view class="num">{{num}}</view>
|
||||
<view class="add" bind:tap="add">+</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -63,11 +63,13 @@
|
||||
}
|
||||
|
||||
.reverse {
|
||||
width: 19rpx;
|
||||
height: 3rpx;
|
||||
background-color: #97DFB4;
|
||||
width: 23rpx;
|
||||
height: 23rpx;
|
||||
/* background-color: #97DFB4; */
|
||||
margin: 0 auto;
|
||||
margin-top: 25rpx;
|
||||
margin-top: 20rpx;
|
||||
line-height: 23rpx;
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
.num {
|
||||
@ -79,7 +81,8 @@
|
||||
.add {
|
||||
width: 23rpx;
|
||||
height: 23rpx;
|
||||
background-color: #242424;
|
||||
/* background-color: #242424; */
|
||||
margin: 0 auto;
|
||||
margin-bottom: 17rpx;
|
||||
line-height: 23rpx;
|
||||
}
|
@ -1,9 +1,20 @@
|
||||
import {request} from "../../utils/bin"
|
||||
Page({
|
||||
data:{
|
||||
|
||||
list:[]
|
||||
},
|
||||
onLoad(){
|
||||
|
||||
request({
|
||||
url:"Goods/hotGoodsList",
|
||||
data:{
|
||||
page:0
|
||||
}
|
||||
}).then((res)=>{
|
||||
console.log(res.data.result)
|
||||
this.setData({
|
||||
list:res.data.result
|
||||
})
|
||||
})
|
||||
},
|
||||
searchs(){
|
||||
console.log(10)
|
||||
|
@ -1,4 +1,4 @@
|
||||
<view class="box">
|
||||
<search bind:tap="searchs"></search>
|
||||
<list></list>
|
||||
<list list="{{list}}"></list>
|
||||
</view>
|
86
pages/login/login.js
Normal file
86
pages/login/login.js
Normal file
@ -0,0 +1,86 @@
|
||||
// pages/login/login.js
|
||||
import {request} from "../../utils/bin"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
login(a){
|
||||
console.log(a)
|
||||
wx.login({
|
||||
success (res) {
|
||||
if (res.code) {
|
||||
//发起网络请求
|
||||
request({
|
||||
url:"User/getopenId",
|
||||
data:{
|
||||
js_code:res.code
|
||||
}
|
||||
}).then((res)=>{
|
||||
console.log(res)
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
3
pages/login/login.json
Normal file
3
pages/login/login.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
3
pages/login/login.wxml
Normal file
3
pages/login/login.wxml
Normal file
@ -0,0 +1,3 @@
|
||||
<view>
|
||||
<button open-type="getUserInfo" bindgetuserinfo="login">登录</button>
|
||||
</view>
|
1
pages/login/login.wxss
Normal file
1
pages/login/login.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* pages/login/login.wxss */
|
@ -5,14 +5,17 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
openid:"",
|
||||
username:"啦啦啦"
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
this.setData({
|
||||
openid:wx.getStorageSync("openid")
|
||||
})
|
||||
},
|
||||
toorder() {
|
||||
wx.navigateTo({
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="card">
|
||||
<view class="user">
|
||||
<image class="head"></image>
|
||||
<text>于于于宇于</text>
|
||||
<text bind:tap="login">{{openid == ""?'点击登录':username}}</text>
|
||||
</view>
|
||||
<view class="balance">
|
||||
<text>账户余额</text>
|
||||
|
@ -5,7 +5,7 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
list:[1,1,1]
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,8 @@
|
||||
<view class="shopping">
|
||||
<view class="item">
|
||||
<view class="item" wx:for="{{list}}" wx:for-index="j" wx:if = "{{item == 1}}" wx:key="{{j}}">
|
||||
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>
|
||||
</view>
|
||||
<!-- <view class="item">
|
||||
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>
|
||||
</view>
|
||||
<view class="item">
|
||||
@ -7,10 +10,7 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>
|
||||
</view>
|
||||
<view class="item">
|
||||
<shopping-item shopname="J`adore - Dior" shopdesc="30支 1.30kg" price="61.78"></shopping-item>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="bottom">
|
||||
<view class="left">
|
||||
<view class="select"></view>
|
||||
|
@ -1,4 +1,7 @@
|
||||
.item {
|
||||
.shopping{
|
||||
padding-bottom: 128rpx;
|
||||
}
|
||||
.item {
|
||||
height: 186rpx;
|
||||
margin-left: 46rpx;
|
||||
margin-top: 59rpx;
|
||||
|
@ -4,19 +4,27 @@
|
||||
"ignore": []
|
||||
},
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"urlCheck": false,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"newFeature": true,
|
||||
"autoAudits": false,
|
||||
"coverView": true,
|
||||
"autoAudits": false,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"scopeDataCheck": false
|
||||
"scopeDataCheck": false,
|
||||
"checkInvalidKey": true,
|
||||
"checkSiteMap": true,
|
||||
"uploadWithSourceMap": true,
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "2.9.4",
|
||||
"appid": "wx5766b7aac7c938b3",
|
||||
"appid": "wxb9033316008de1ce",
|
||||
"projectname": "deguodaigou",
|
||||
"debugOptions": {
|
||||
"hidedInDevtools": []
|
||||
|
11
utils/bin.js
11
utils/bin.js
@ -2,15 +2,24 @@
|
||||
let request = function (obj){
|
||||
let {
|
||||
url,
|
||||
data,
|
||||
method,
|
||||
header,
|
||||
dataType,
|
||||
responseType,
|
||||
complete
|
||||
} = obj
|
||||
url="http://daigou.sdbairui.com/index.php/WXAPI/" + url
|
||||
if(method == "POST" || method == "post"){
|
||||
if(header == undefined){
|
||||
header ={}
|
||||
}
|
||||
header['content-type'] = "application/x-www-form-urlencoded"
|
||||
}
|
||||
return new Promise((res,rej)=>{
|
||||
Wx.request({
|
||||
wx.request({
|
||||
url,
|
||||
data,
|
||||
method,
|
||||
header,
|
||||
dataType,
|
||||
|
Loading…
Reference in New Issue
Block a user