合同小程序前端代码仓库
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.

348 lines
6.9 KiB

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