第一次提交

This commit is contained in:
gxwebsoft
2023-08-04 13:04:21 +08:00
commit 7a73b38bd5
764 changed files with 166417 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<template>
<!-- 搜索框 -->
<view class="search-wrapper">
<view class="index-search" @click="onClick">
<view class="index-cont-search t-c">
<text class="search-icon iconfont icon-search"></text>
<text class="search-text">{{ tips }}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
tips: {
type: String,
default: '搜索关键词'
}
},
data() {
return {}
},
methods: {
onClick() {
this.$emit('event')
}
}
}
</script>
<style lang="scss" scoped>
.search-wrapper {
padding: 13rpx;
}
.index-search {
border-bottom: 0;
border-radius: 50rpx;
overflow: hidden;
font-size: 28rpx;
color: #6d6d6d;
box-sizing: border-box;
line-height: 64rpx;
display: flex;
align-items: center;
.index-cont-search {
width: 100%;
font-size: 28rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
}
.index-cont-search .search-icon {
font-size: 28rpx;
}
.index-cont-search .search-text {
margin-left: 14rpx;
}
}
</style>

228
package/brand/detail.vue Normal file
View File

@@ -0,0 +1,228 @@
<template>
<view class="partner">
<!-- 表单组件 -->
<view class="form-wrapper" v-if="detail">
<u-form :model="form" ref="uForm" label-width="240rpx">
<u-form-item>
<image :src="detail.imageUrl" mode="widthFix" class="banner"></image>
<view class="brand-name">{{detail.name}}</view>
</u-form-item>
<u-form-item>
<view class="shop-box">
<text class="shop-name">品牌介绍</text>
<text>{{detail.describe}}</text>
</view>
</u-form-item>
<view class="buy-desc">如果有意向请填写以下信息给平台留言</view>
<!-- 表单组件 -->
<view class="form-wrapper">
<u-form :model="form" ref="uForm" label-width="140rpx">
<u-form-item label="姓名" prop="real_name">
<u-input v-model="form.real_name" :disabled="disabled" placeholder="请输入姓名" />
</u-form-item>
<u-form-item label="电话" prop="phone">
<u-input v-model="form.phone" maxlength="11" :disabled="disabled" placeholder="请输入联系电话" />
</u-form-item>
<u-form-item label="性别" prop="sex">
<u-radio-group v-model="form.sex">
<u-radio @change="groupChange" v-for="(item, index) in sex" :key="index"
:name="item.name" :disabled="item.disabled">
{{item.name}}
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="定制预算" prop="money">
<u-input type="number" v-model="form.money" :disabled="disabled" placeholder="请输入定制预算" />
</u-form-item>
<u-form-item label="微信号" prop="weixin">
<u-input v-model="form.weixin" :disabled="disabled" placeholder="请输入微信号" />
</u-form-item>
<u-form-item label="意向区域" prop="region">
<select-region ref="sRegion" :disabled="disabled" v-model="form.region" />
</u-form-item>
<u-form-item label="整体需求" prop="comments">
<u-input v-model="form.comments" :disabled="disabled" placeholder="请输入整体需求" />
</u-form-item>
</u-form>
</view>
<!-- 操作按钮 -->
<view class="footer">
<view class="btn">
<u-button type="primary" shape="circle" @click="handleSubmit()">提交</u-button>
</view>
</view>
</u-form>
</view>
<!-- 操作按钮 -->
<!-- <view class="footer">
<view class="btn">
<u-button type="primary" shape="circle">更新资料</u-button>
</view>
</view> -->
</view>
</template>
<script>
// 表单字段元素
const form = {
name: '',
phone: '',
sex: '',
money: '',
region: [],
weixin: '',
comments: '',
}
const sex = [{
name: '男',
value: 1,
disabled: false
},
{
name: '女',
value: 2,
disabled: false
}
]
import * as Api from '@/api/brand/index.js'
import * as ApplyApi from '@/api/brand/apply.js'
import SelectRegion from '@/components/select-region/select-region'
export default {
components: {
SelectRegion
},
data() {
return {
form,
disabled: false,
detail: {},
brandId: 0,
sex
}
},
onLoad(options) {
this.brandId = options.brandId
this.init()
},
methods: {
// 获取当前用户信息
init() {
const app = this
const {
brandId
} = this
console.log(brandId);
Api.detail(brandId).then(result => {
app.detail = result.data.detail
})
},
groupChange(e) {
this.form.sex = e
},
// 表单提交
handleSubmit() {
const app = this
// if (app.disabled) {
// return false
// }
const {
form,
brandId
} = this
form.brand_id = brandId
app.$refs.uForm.validate(valid => {
if (valid) {
app.disabled = true
app.onSubmit()
}
})
},
// 提交到后端
onSubmit() {
const app = this
const {
form
} = this
let req;
if (form.apply_status == 30) {
req = ApplyApi.edit(form.apply_id, form)
} else {
console.log('add');
req = ApplyApi.add(form)
}
req.then(result => {
console.log("result: ", result);
app.$toast(result.message)
setTimeout(function() {
uni.navigateBack()
}, 2000)
})
.finally(() => app.disabled = false)
}
}
}
</script>
<style lang="less">
.partner {
.banner {
padding-top: 20rpx;
width: 100%;
}
.form-wrapper {
margin: 20rpx auto 20rpx auto;
padding: 0 40rpx;
width: 94%;
box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
border-radius: 16rpx;
background: #fff;
.shop-box {
text-align: center;
display: flex;
flex-direction: column;
.shop-name {
font-weight: bold;
font-size: 36rpx;
}
}
.logo {
width: 100rpx;
}
.shipin {
width: 400rpx;
}
}
.footer {
width: 500rpx;
margin: 50rpx auto;
padding-bottom: 50rpx !important;
}
}
.brand-name {
text-align: center;
}
.buy-desc {
text-align: center;
color: #ff0000;
margin-top: 40rpx;
}
.buy-text {
text-align: center;
}
</style>

68
package/brand/index.vue Normal file
View File

@@ -0,0 +1,68 @@
<template>
<view class="solution">
<!-- <view class="search">
<search class="search" :tips="options.search ? options.search : '搜索关键词'" @event="handleSearch" />
</view> -->
<view class="grid">
<u-grid :border="false">
<u-grid-item v-for="(item,index) in baseList" :key="index">
<image :src="item.imageUrl" class="avatar" mode="widthFix" @click="navTo('package/brand/detail?brandId=' + item.brandId)"></image>
<text class="grid-text" @click="navTo('package/brand/detail?brandId=' + item.brandId)">{{item.name}}</text>
</u-grid-item>
</u-grid>
</view>
</view>
</template>
<script>
import Search from './components/search'
import * as Api from '@/api/brand/index.js'
export default {
components: {
Search
},
data() {
return {
baseList: []
}
},
onLoad(){
this.init()
},
methods: {
init(){
const app = this
Api.list().then(res => {
app.baseList = res.data.list.data
})
},
navTo(url){
this.$navTo(url)
}
}
}
</script>
<style lang="less">
.solution {
background-color: #ffffff;
.search {
padding: 10rpx 20rpx;
}
.btn {
width: 700rpx;
border-radius: 100%;
margin: 25rpx auto;
}
.grid {
width: 700rpx;
margin: auto;
}
.avatar {
width: 120rpx;
}
}
</style>