Browse Source

更新

master
453530270@qq.com 2 years ago
parent
commit
b944d5e8fb
  1. 6
      config.js
  2. 30
      manifest.json
  3. 8
      pages.json
  4. 30
      pages/goods/list.vue
  5. 322
      pages/reg/reg.vue
  6. 2
      utils/request/index.js

6
config.js

@ -10,13 +10,13 @@ module.exports = {
// apiUrl: "http://58.30.231.137:8022/",
// apiUrl: "http://10.24.4.156/api/",
// product env
// apiUrl: "http://10.24.4.14:80/kk",
// apiUrl: "http://10.24.4.14:80/",
apiUrl: "./kk/",
/**
/**
* 是否启用商城设置缓存
* 将减少用户端重复请求; 正式运营时请设为true, 开启后商城设置同步前端需10分钟缓存
*/
enabledSettingCache: false,
enabledSettingCache: true,
}

30
manifest.json

@ -107,20 +107,20 @@
"mode" : "history",
"base" : "./"
},
"devServer": {
"https": false,
"disableHostCheck" : true,
// "port": 8080,
"proxy":{
"/kk" : {
"target" : "http://10.24.4.14", //
"changeOrigin" : true,
"secure" : true,
"pathRewrite" : {
"^/kk" : "/"
}
}
}
}
"devServer" : {
"https" : false,
"disableHostCheck" : true,
// "port": 8080,
"proxy" : {
"/kk" : {
"target" : "http://10.24.4.14", //
"changeOrigin" : true,
"secure" : true,
"pathRewrite" : {
"^/kk" : "/"
}
}
}
}
}
}

8
pages.json

@ -233,6 +233,14 @@
"style": {
"navigationBarTitleText": "申请售后"
}
},
{
"path" : "pages/reg/reg",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {

30
pages/goods/list.vue

@ -2,7 +2,7 @@
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<!-- 页面头部 -->
<view class="header">
<search class="search" :tips="options.search ? options.search : '搜索商品'" @event="handleSearch" />
<search class="search" :tips="options.search ? options.search : '搜索标的'" @event="handleSearch" />
<!-- 切换列表显示方式 -->
<view class="show-view" @click="handleShowView">
<text class="iconfont icon-view-tile" v-if="showView"></text>
@ -11,7 +11,7 @@
</view>
<!-- 排序标签 -->
<view class="store-sort">
<!-- <view class="store-sort">
<view class="sort-item" :class="{ active: sortType === 'all' }" @click="handleSortType('all')">
<text>综合</text>
</view>
@ -29,9 +29,9 @@
</view>
</view>
</view>
</view>
</view> -->
<!-- 商品列表 -->
<!-- 标的列表 -->
<view class="goods-list clearfix" :class="['column-' + (showView ? '1' : '2')]">
<view class="goods-item" v-for="(item, index) in list.data" :key="index" @click="onTargetDetail(item.goods_id)">
<!-- 单列显示 -->
@ -158,21 +158,27 @@
},
/**
* 获取商品列表
* 获取标的列表
* @param {number} pageNo 页码
*/
getGoodsList(pageNo = 1) {
const app = this
console.log(app.options)
// console.log(app.options)
// {"authorization":"","record_type":"","entrust_name":"",
// "entrust_user_name":"","source_type":"","order_type":"createtime",
// "order":"desc","goods_status":1,"page":1,"limit":8}
const param = {
sortType: app.sortType,
sortPrice: Number(app.sortPrice),
categoryId: app.options.categoryId || 0,
goodsName: app.options.search || '',
page: pageNo
"pay_type":2,"goods_status":1,"page":1,"limit":6
// order: 'desc',
// order_type: 'createtime',
// entrust_user_name: app.options.k,
// goods_status: '1',
// page: pageNo,
// limit: 4
}
return new Promise((resolve, reject) => {
GoodsApi.list(param)
GoodsApi.soglist(param)
//GoodsApi.list(param)
.then(result => {
//
const newList = result.data.list

322
pages/reg/reg.vue

@ -0,0 +1,322 @@
<template>
<view class="container">
<!-- 页面头部 -->
<view class="header">
<view class="title">
<text>登录</text>
</view>
</view>
<!-- 表单 -->
<view class="login-form">
<!-- 手机号 -->
<view class="form-item">
<input class="form-item--input" type="number" v-model="mobile" maxlength="11" autocomplete="off" placeholder="请输入手机号码" />
</view>
<!-- 密码 -->
<view class="form-item">
<input class="form-item--input" type="password" v-model="vpass" autocomplete="off" placeholder="请输入密码" />
</view>
<!-- 选择机构个人 -->
<radio-group @change="radioChange">
<view class="form-item">
<radio class="radio" color="#4399ff" value="企业" :checked="utchk1"/> 机构
</view>
<view class="form-item">
<radio class="radio" color="#4399ff" value="个人" :checked="utchk2"/> 个人
</view>
</radio-group>
<!-- 登录按钮 -->
<view class="login-button" @click="handleLogin">
<text>登录</text>
</view>
</view>
<!-- 找回密码 注册 -->
<view class="fdreg">
<text class="findpass">找回密码</text>
<text class="regnow">立即注册</text>
</view>
<!-- 隐私政策等 -->
<div class="privacy">
<label>
<checkbox :checked="isTick" color="#4399ff" class="ckbox" @click="readpri"></checkbox>
我已阅读并同意网站的 隐私政策 用户注册协议
</label>
</div>
</view>
</template>
<script>
import store from '@/store'
import * as LoginApi from '@/api/login'
import * as Verify from '@/utils/verify'
export default {
components: {
// nothing
},
props: {
//
isParty: {
type: Boolean,
default: () => false
},
//
partyData: {
type: Object
}
},
data() {
return {
//
isLoading: false,
//
mobile: '',
//
vpass:"",
//
isTick:false,
// user type
userType:"",
//
utchk1:true,
utchk2:false,
}
},
/**
* 生命周期函数--监听页面加载
*/
created() {
console.log('main created')
},
methods: {
//
radioChange(evt) {
this.userType = evt.detail.value
if(this.userType=="企业"){
this.utchk2=false
this.utchk1=true;
}else{
this.utchk2=true
this.utchk1=false;
}
let bb = this.$md5("123456")
},
//
readpri(e){
this.isTick=!this.isTick
},
//
formValidation() {
const app = this
//
if (!app.validteMobile(app.mobile) ||!app.validtePass(app.vpass)) {
return false
}
//
if(app.utchk1){
this.userType="企业"
}
if(app.utchk2){
this.userType ="个人"
}
//
if(!app.isTick){
this.$toast("请勾选《隐私保护政策》和《用户注册协议》")
return false
}
return true
},
//
validtePass(str){
if (Verify.isEmpty(str)) {
this.$toast('请先输入登录密码')
return false
}
return true;
},
//
validteMobile(str) {
if (Verify.isEmpty(str)) {
this.$toast('请先输入手机号')
return false
}
if (!Verify.isMobile(str)) {
this.$toast('请输入正确格式的手机号')
return false
}
return true
},
//
handleLogin() {
const app = this
if (!app.isLoading && app.formValidation()) {
app.submitLogin()
}
},
//
submitLogin() {
const app = this
app.isLoading = true
store.dispatch('Login', {
loginName: app.mobile,
loginType: "0",
password: this.$md5(app.vpass).toUpperCase(), //
userType: app.userType
})
.then(result => {
//
app.$toast(result.message)
// :
uni.$emit('syncRefresh', true)
//
setTimeout(() => app.onNavigateBack(1), 2000)
})
.catch(err => {
console.log("err",err)
//
if (err.result.data.isBack) {
setTimeout(() => app.onNavigateBack(1), 2000)
}
})
.finally(() => app.isLoading = false)
},
/**
* 登录成功-跳转回原页面
*/
onNavigateBack(delta = 1) {
const pages = getCurrentPages()
if (pages.length > 1) {
uni.navigateBack({
delta: Number(delta || 1)
})
} else {
this.$navTo('pages/index/index')
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
padding: 100rpx 60rpx;
min-height: 100vh;
background-color: #fff;
}
//
.header {
margin-bottom: 60rpx;
.title {
color: #191919;
font-size: 54rpx;
}
}
//
.form-item {
display: flex;
padding: 18rpx;
border-bottom: 1rpx solid #f3f1f2;
margin-bottom: 30rpx;
height: 96rpx;
&--input {
font-size: 28rpx;
letter-spacing: 1rpx;
flex: 1;
height: 100%;
}
&--parts {
min-width: 100rpx;
height: 100%;
}
&--radgrp{
display: flex;
flex:1;
height: 100%;
}
//
.captcha-sms {
font-size: 28rpx;
line-height: 50rpx;
padding-right: 20rpx;
.activate {
color: #cea26a;
}
.un-activate {
color: #9e9e9e;
}
}
}
//
.login-button {
width: 100%;
height: 86rpx;
margin-top: 80rpx;
background: linear-gradient(to right, #242e4b, #242e4b);
color: #fff;
// border-radius: 80rpx;
box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1);
letter-spacing: 5rpx;
display: flex;
justify-content: center;
align-items: center;
}
//
.fdreg{
display: flex;
margin-top: 26rpx;
line-height: 1.4;
color:#ff0000;
padding-left: 32rpx;
padding-right: 32rpx;
text{
display: block;
float: left;
width: 46%;
}
.findpass{
text-align: left;
}
.regnow{
text-align: right;
}
}
.privacy{
display: flex;
margin-top: 10rpx;
}
</style>

2
utils/request/index.js

@ -21,7 +21,7 @@ const $http = new request({
'Content-Type': 'application/json;charset=UTF-8'
},
// 请求超时时间, 单位ms(默认15000)
timeout: 60000,
timeout: 360000000,
// 默认配置(可不写)
config: {
// 是否自动提示错误

Loading…
Cancel
Save