diff --git a/common/api/shop.js b/common/api/shop.js
new file mode 100644
index 0000000..bc51f99
--- /dev/null
+++ b/common/api/shop.js
@@ -0,0 +1,10 @@
+export default {
+ init(vm){
+ return {
+ postlogn({id,name}){
+ return vm.$u.get('url',{id,name});
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/common/api/user.js b/common/api/user.js
new file mode 100644
index 0000000..036d2e4
--- /dev/null
+++ b/common/api/user.js
@@ -0,0 +1,10 @@
+export default {
+ init(vm){
+ return {
+ getlogn({id,name}){
+ return vm.$u.get('popArticles');
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/common/http.api.js b/common/http.api.js
new file mode 100644
index 0000000..0761798
--- /dev/null
+++ b/common/http.api.js
@@ -0,0 +1,16 @@
+
+// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
+// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
+import shop from "./api/shop"
+import user from "./api/user"
+
+const install = (Vue, vm) => {
+ let userapi = user.init(vm)
+ let shopapi = shop.init(vm)
+ // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
+ vm.$u.api = {...userapi,...shopapi};
+}
+
+export default {
+ install
+}
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
new file mode 100644
index 0000000..45ec848
--- /dev/null
+++ b/common/http.interceptor.js
@@ -0,0 +1,62 @@
+const install = (Vue, vm) => {
+ // 此为自定义配置参数,具体参数见上方说明
+ Vue.prototype.$u.http.setConfig({
+ baseUrl: 'https://luyuan.tk/api',
+ loadingText: '努力加载中~',
+ loadingTime: 800
+ // ......
+ });
+
+ // 请求拦截,配置Token等参数
+ Vue.prototype.$u.http.interceptor.request = (config) => {
+ // 引用token
+ // 方式一,存放在vuex的token,假设使用了uView封装的vuex方式
+ // 见:https://uviewui.com/components/globalVariable.html
+ // config.header.token = vm.token;
+
+ // 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
+ // config.header.token = vm.$store.state.token;
+
+ // 方式三,如果token放在了globalData,通过getApp().globalData获取
+ // config.header.token = getApp().globalData.username;
+
+ // 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的
+ // 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
+ // const token = uni.getStorageSync('token');
+ // config.header.token = token;
+ // config.header.Token = 'xxxxxx';
+
+ // 可以对某个url进行特别处理,此url参数为this.$u.get(url)中的url值
+ // if(config.url == '/user/login') config.header.noToken = true;
+ // 最后需要将config进行return
+ return config;
+ // 如果return一个false值,则会取消本次请求
+ // if(config.url == '/user/rest') return false; // 取消某次请求
+ }
+
+ // // 响应拦截,判断状态码是否通过
+ // Vue.prototype.$u.http.interceptor.response = (res) => {
+ // if(res.code == 200) {
+ // // res为服务端返回值,可能有code,result等字段
+ // // 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
+ // // 如果配置了originalData为true,请留意这里的返回值
+ // return res.result;
+ // } else if(res.code == 201) {
+ // // 假设201为token失效,这里跳转登录
+ // vm.$u.toast('验证失败,请重新登录');
+ // setTimeout(() => {
+ // // 此为uView的方法,详见路由相关文档
+ // vm.$u.route('/pages/user/login')
+ // }, 1500)
+ // return false;
+ // } else {
+ // // 如果返回false,则会调用Promise的reject回调,
+ // // 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
+ // return false;
+ // }
+ // }
+}
+
+export default {
+ install
+}
diff --git a/components/shop/group/index.vue b/components/shop/group/index.vue
new file mode 100644
index 0000000..bae48f7
--- /dev/null
+++ b/components/shop/group/index.vue
@@ -0,0 +1,66 @@
+
+
+
+ 全部拼团
+ 查看更多>
+
+
+ sda
+ asda
+ dsad
+ asdas
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/group/item.vue b/components/shop/group/item.vue
new file mode 100644
index 0000000..cac3f6e
--- /dev/null
+++ b/components/shop/group/item.vue
@@ -0,0 +1,47 @@
+
+
+
+ 商品名
+
+ ¥99
+ 立即购买
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/list/index.vue b/components/shop/list/index.vue
new file mode 100644
index 0000000..4a02a41
--- /dev/null
+++ b/components/shop/list/index.vue
@@ -0,0 +1,54 @@
+
+
+
+ 商品推荐
+
+
+ asd
+ sda
+ w3eq
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/list/item.vue b/components/shop/list/item.vue
new file mode 100644
index 0000000..23be604
--- /dev/null
+++ b/components/shop/list/item.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/recommend/index.vue b/components/shop/recommend/index.vue
new file mode 100644
index 0000000..4c38bbb
--- /dev/null
+++ b/components/shop/recommend/index.vue
@@ -0,0 +1,101 @@
+
+
+
+ 今日秒杀推荐
+ 点击查看更多>
+
+
+
+
+ 12:00
+
+
+ 修身套头上衣
+ 珂莱蒂尔雪纺衫2020春装新简约百搭V领蕾丝九分...
+
+ ¥99
+ ¥299
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/seckill/index.vue b/components/shop/seckill/index.vue
new file mode 100644
index 0000000..fdf87ac
--- /dev/null
+++ b/components/shop/seckill/index.vue
@@ -0,0 +1,71 @@
+
+
+
+
+ 全部秒杀
+
+ 12
+ :
+ 12
+ :
+ 12
+
+
+
+ 查看更多>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/seckill/item.vue b/components/shop/seckill/item.vue
new file mode 100644
index 0000000..f5af869
--- /dev/null
+++ b/components/shop/seckill/item.vue
@@ -0,0 +1,63 @@
+
+
+
+ 商品名
+
+ ¥99
+ ¥299
+
+
+ 剩余21件
+ 立即购买
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/shop-item/index.vue b/components/shop/shop-item/index.vue
new file mode 100644
index 0000000..899b3b8
--- /dev/null
+++ b/components/shop/shop-item/index.vue
@@ -0,0 +1,29 @@
+
+
+
+ 名字哦
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/youhq/index.vue b/components/shop/youhq/index.vue
new file mode 100644
index 0000000..ac25922
--- /dev/null
+++ b/components/shop/youhq/index.vue
@@ -0,0 +1,72 @@
+
+
+
+ 全部优惠券
+ 查看更多>
+
+
+ sda
+ asda
+ dsad
+ asdas
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/shop/youhq/item.vue b/components/shop/youhq/item.vue
new file mode 100644
index 0000000..f9a6923
--- /dev/null
+++ b/components/shop/youhq/item.vue
@@ -0,0 +1,83 @@
+
+
+
+
+ ¥
+ 12
+
+
+
+
+
+
+ 立即
领取
+
+
+
+ 使用时间:2020.01.24-2020.05.08
+
+
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
index dc6b511..bce4f0b 100644
--- a/main.js
+++ b/main.js
@@ -8,4 +8,11 @@ App.mpType = 'app'
const app = new Vue({
...App
})
+// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
+import httpInterceptor from '@/common/http.interceptor.js'
+Vue.use(httpInterceptor, app)
+
+// http接口API集中管理引入部分
+import httpApi from '@/common/http.api.js'
+Vue.use(httpApi, app)
app.$mount()
diff --git a/pageB/components/sdetails/navs.vue b/pageB/components/sdetails/navs.vue
new file mode 100644
index 0000000..6d942bc
--- /dev/null
+++ b/pageB/components/sdetails/navs.vue
@@ -0,0 +1,30 @@
+
+
+ dsadasdas
+
+
+
+
+
\ No newline at end of file
diff --git a/pageB/components/sdetails/tloos.vue b/pageB/components/sdetails/tloos.vue
new file mode 100644
index 0000000..05ff9aa
--- /dev/null
+++ b/pageB/components/sdetails/tloos.vue
@@ -0,0 +1,55 @@
+
+
+
+
+ 123
+
+
+
+ 123
+
+ 试穿试送
+ 加入购物车
+ 立即购买
+
+
+
+
\ No newline at end of file
diff --git a/pageB/components/sdetails/youhuiitem.vue b/pageB/components/sdetails/youhuiitem.vue
new file mode 100644
index 0000000..9d12710
--- /dev/null
+++ b/pageB/components/sdetails/youhuiitem.vue
@@ -0,0 +1,53 @@
+
+
+
+
+ ¥41
+ 店铺优惠券
+
+ 新用户可用
+ 有效期2018.09.06-2018.10.06
+
+ 立即领取
+
+
+
+
+
\ No newline at end of file
diff --git a/pageB/components/sdetails/youhuiquan.vue b/pageB/components/sdetails/youhuiquan.vue
new file mode 100644
index 0000000..44ffe75
--- /dev/null
+++ b/pageB/components/sdetails/youhuiquan.vue
@@ -0,0 +1,27 @@
+
+
+
+ 优惠券详情
+
+
+ 领取优惠券
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pageB/sdetails/index.vue b/pageB/sdetails/index.vue
new file mode 100644
index 0000000..904587f
--- /dev/null
+++ b/pageB/sdetails/index.vue
@@ -0,0 +1,113 @@
+
+
+
+
+
+ 萨的环境
+
+ 套装新款小个子春季时尚韩版短袖衬衫套装
+新款小个子春季时尚韩版...
+
+
+
+ ¥24
+ ¥12
+
+
+
+
+
+
+
+
+ 商品详情
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index f34207b..c68b7d9 100644
--- a/pages.json
+++ b/pages.json
@@ -83,6 +83,17 @@
}
}
},
+ {
+ "path": "sdetails/index",
+ "style": {
+ "navigationBarTitleText": "商品详情",
+ "app-plus":{
+ "titleNView":{
+ "backgroundColor":"#ffffff"
+ }
+ }
+ }
+ },
{
"path": "search/index",
"style": {
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 764365a..00ccb41 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -196,6 +196,14 @@ export default {
this.num = a
}
}
+ },
+ onLoad(){
+ this.$u.api.getlogn({
+ id:1,
+ name:2
+ }).then((res)=>{
+ console.log(res)
+ })
}
}
\ No newline at end of file
diff --git a/pages/shop/index.vue b/pages/shop/index.vue
new file mode 100644
index 0000000..e348895
--- /dev/null
+++ b/pages/shop/index.vue
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 免费洗衣
+
+
+
+ 全国包邮
+
+
+
+ 延误必赔
+
+
+
+ 上门取件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/js/http.js b/static/js/http.js
new file mode 100644
index 0000000..fa5bec7
--- /dev/null
+++ b/static/js/http.js
@@ -0,0 +1 @@
+let baseurl = "";