合同小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

361 lines
7.3 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部标题 -->
  4. <view class="header">
  5. <view class="header_info">
  6. <text class="header_texts" :title="title">{{title}}</text>
  7. <text class="header_info_icon">|</text>
  8. <view @click="change_text" class="header_change">
  9. <text >切换</text>
  10. <uni-icons type="right" size="30" color="#c2d4de" ></uni-icons>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="swiper">
  15. <image class="swiper-image" src="/static/image/组 71699.png"></image>
  16. </view>
  17. <view class="sales">
  18. <view class="sales_left ">
  19. <text>总订单</text>
  20. <text>本月订单 : {{orderCount}}</text>
  21. <text>销售额:{{totalMoney}}</text>
  22. </view>
  23. </view>
  24. <view class="sales">
  25. <view class="sales_left " v-for="(item,index) in orderTypeCount">
  26. <text>{{item.productType}}</text>
  27. <text>本月订单 : {{item.orderCount}}</text>
  28. <text>销售额:{{item.totalMoney}}</text>
  29. </view>
  30. </view>
  31. <view class="order_Entry_container" @click="orderEntry">
  32. <image class="order_Entry_image" src="/static/image/组 71699_1@3x.png"></image>
  33. <text style="color: #115881;font-weight: bold;margin-left: 1rem;">录入订单</text>
  34. <uni-icons class="order_Entry_end" type="right" :size="25" color="#306e91"></uni-icons>
  35. </view>
  36. <view v-if="isshow" class="show_container">
  37. <view class="isshow-header">
  38. <uni-icons class=" isshow-header-content-icon" type="search" :size="20"></uni-icons>
  39. <uni-easyinput :inputBorder="false" @input="handleSearch" class=" isshow-header-content-input" v-model="ServiceName" placeholder="请输入服务名称" />
  40. <text class="isshow-header-content-text" @click="searchName">搜索</text>
  41. </view>
  42. <view class="isshow-content" >
  43. <text class="isshow-content-text" v-for="(item, index) in textcontent" :key="index" @click="change_city(item.storeName,item.address)">{{item.storeName}}</text>
  44. </view>
  45. </view>
  46. <view v-if="isshow_1" class="show_container_1">
  47. <image class="show_container_1_image" src="/static/image/图层_6.png"></image>
  48. <view class="show_container_1_footer">
  49. <text>门店已经切换为{{title}}</text>
  50. <button class="show_container_1_footer_button" @click="close_view">好的</button>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {getStoreName,isToken,statistics,getList} from '@/api.uts'
  57. export default {
  58. data() {
  59. return {
  60. ServiceName:'',
  61. title:"北京汽车有限公司",
  62. isshow:false,
  63. isshow_1:false,
  64. newListData:[],
  65. textcontent: [],
  66. orderTypeCount:[],
  67. orderCount:0,
  68. totalMoney:0
  69. };
  70. },
  71. mounted() {
  72. isToken();
  73. getStoreName().then((res)=>{
  74. getApp().allMsg=res.result;
  75. this.textcontent = res.result;
  76. this.title = res.result[0].storeName;
  77. getApp().storeName = res.result[0].storeName;
  78. getApp().dealerAddress = res.result[0].address;
  79. }
  80. );
  81. statistics().then((res)=>{
  82. console.log(res.result);
  83. this.orderCount = res.result.orderCount
  84. this.totalMoney = res.result.totalMoney
  85. this.orderTypeCount = res.result.orderTypeCount
  86. })
  87. },
  88. methods: {
  89. change_text(){
  90. if(this.isshow){
  91. this.isshow=false;
  92. }else{
  93. this.isshow=true;
  94. }
  95. },
  96. orderEntry(){
  97. uni.navigateTo(
  98. { url: '/pages/views/dingDanCreate' }
  99. )
  100. },
  101. // 搜索城市名字
  102. searchName(){
  103. if(this.ServiceName){
  104. this.textcontent = [];
  105. getApp().allMsg.map(item => {
  106. if (item.storeName.indexOf(this.ServiceName) !== -1) {
  107. this.textcontent.push(item);
  108. }
  109. });
  110. }else {
  111. this.textcontent=[];
  112. this.textcontent = getApp().allMsg;
  113. }
  114. },
  115. change_city(name,address){
  116. this.title = name;
  117. this.change_text();
  118. this.isshow_1 = true;
  119. getApp().storeName = this.title;
  120. getApp().dealerAddress = address;
  121. },
  122. close_view(){
  123. this.isshow_1 = false;
  124. },
  125. // 模糊匹配
  126. // 右上角搜索框--模糊查询
  127. handleSearch(event) {
  128. console.log(event);
  129. if(event){
  130. this.textcontent = [];
  131. getApp().allMsg.map(item => {
  132. if (item.storeName.indexOf(event) !== -1) {
  133. this.textcontent.push(item);
  134. }
  135. });
  136. }else {
  137. this.textcontent=[];
  138. this.textcontent = getApp().allMsg;
  139. }
  140. }
  141. }
  142. };
  143. </script>
  144. <style>
  145. /* 订单录入 */
  146. .order_Entry_container{
  147. width: 90%;
  148. height: 8%;
  149. background-color: #d9e5eb;
  150. border-radius: 0.6rem;
  151. margin-left:5%;
  152. display: flex;
  153. flex-direction: row;
  154. align-items: center;
  155. margin-top: 5%;
  156. }
  157. .order_Entry_image{
  158. width: 10%;
  159. height: 70%;
  160. margin-left: 3%;
  161. }
  162. .order_Entry_end{
  163. margin-left: auto;
  164. margin-right: 7%;
  165. }
  166. /* 轮播图 */
  167. .swiper {
  168. height: 30%;
  169. width: 100%;
  170. display: flex;
  171. flex-direction: row;
  172. align-items: center;
  173. overflow: hidden;
  174. }
  175. .swiper-image {
  176. width: 100%;
  177. height: 100%;
  178. margin: 0 auto;
  179. }
  180. .form {
  181. flex: 1;
  182. padding: 1rem;
  183. }
  184. .submit-button {
  185. width: 100%;
  186. height: 3rem;
  187. background-color: #007aff;
  188. color: #fff;
  189. border: none;
  190. border-radius: 0.3rem;
  191. font-size: 1rem;
  192. }
  193. .footer {
  194. display: flex;
  195. justify-content: space-around;
  196. padding: 0.8rem;
  197. background-color: #fff;
  198. border-top: 1rem solid #ccc;
  199. }
  200. .nav-item {
  201. text-align: center;
  202. }
  203. .nav-item text {
  204. font-size: 0.9rem;
  205. }
  206. .icon-image{
  207. width: 30%;
  208. height: 10rem;
  209. margin: 0 auto;
  210. margin-top: 1rem;
  211. }
  212. /* 遮罩层 */
  213. .show_container{
  214. width: 60%;
  215. height: 36%;
  216. background-color: #ffffff;
  217. position: absolute;
  218. border-radius: 1rem;
  219. /* border: 1rem solid; */
  220. box-shadow: 0rem 0.2rem 0rem #e4e4e4;
  221. left:5%;
  222. top: 13%;
  223. z-index:999;
  224. display: flex;
  225. flex-direction: column;
  226. align-items: center;
  227. }
  228. .isshow-header{
  229. width: 90%;
  230. height: 30%;
  231. display: flex;
  232. justify-content: center;
  233. align-items: center;
  234. flex-direction: row;
  235. color: #3c7697;
  236. }
  237. .isshow-header-content-icon{
  238. width: 10%;
  239. height: 30%;
  240. }
  241. .isshow-header-content-input{
  242. width: 80%;
  243. height: 40%;
  244. margin: 0 1rem 0 1rem;
  245. border:none;
  246. outline:none;
  247. }
  248. .isshow-content{
  249. height: 70%;
  250. display: flex;
  251. flex-direction: column;
  252. align-items: center;
  253. overflow-y:scroll;
  254. }
  255. .isshow-content-text{
  256. color: #414141;
  257. height: 1.5rem;
  258. width: 100%;
  259. line-height: 1.5rem;
  260. margin: 1rem 0 1rem 0;
  261. font-size: 0.8rem;
  262. }
  263. .isshow-content::-webkit-scrollbar {
  264. display: none;
  265. }
  266. /* 提示框*/
  267. .show_container_1{
  268. width: 80%;
  269. height: 50%;
  270. background-color: #ffffff;
  271. position: absolute;
  272. border-radius: 1rem;
  273. /* border: 1rem solid; */
  274. box-shadow: 0rem 0.2rem 0rem #e4e4e4;
  275. left:10%;
  276. top:25%;
  277. z-index:999;
  278. display: flex;
  279. flex-direction: column;
  280. align-items: center;
  281. }
  282. .show_container_1_image{
  283. height: 40%;
  284. width: 60%;
  285. top: 5%;
  286. }
  287. .show_container_1_footer{
  288. height: 50%;
  289. width: 100%;
  290. color:#0b5583;
  291. display: flex;
  292. flex-direction: column;
  293. align-items: center;
  294. font-weight: bold;
  295. font-size: 0.7rem;
  296. }
  297. .show_container_1_footer text{
  298. margin-top: 10%;
  299. }
  300. .show_container_1_footer_button{
  301. background-color: #ffffff;
  302. color:#0b5583;
  303. height: 30%;
  304. border-radius: 1.8rem;
  305. width: 80%;
  306. margin-top: 5%;
  307. border: 0.1rem solid #0c547e;
  308. display: flex;
  309. justify-content: center;
  310. align-items: center;
  311. }
  312. .sales{
  313. display: flex;
  314. flex-direction: row;
  315. width: 100%;
  316. height: 10%;
  317. align-items: center;
  318. justify-content: center;
  319. /* background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%); */
  320. }
  321. .sales_left{
  322. /* background-color: red ; */
  323. width: 25%;
  324. height: 100%;
  325. display: flex;
  326. align-items: center;
  327. justify-content: center;
  328. /* flex: 1; */
  329. margin: 1rem 2rem 1rem 1rem;
  330. }
  331. .sales_left text{
  332. font-size: 0.7rem;
  333. }
  334. </style>