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

307 lines
6.4 KiB

3 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: 10rpx; font-size: 40rpx;">|</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. <!-- 轮播图 -->
  15. <swiper class="swiper" indicator-dots autoplay interval="3000" duration="500" indicator-color="#ffffff" indicator-active-color="#707070">
  16. <swiper-item>
  17. <image class="swiper-image" src="/static/logo.png" mode="scaleToFill"></image>
  18. </swiper-item>
  19. <swiper-item>
  20. <image class="swiper-image" src="/static/logo.png" mode="scaleToFill"></image>
  21. </swiper-item>
  22. <swiper-item>
  23. <image class="swiper-image" src="/static/logo.png" mode="scaleToFill"></image>
  24. </swiper-item>
  25. </swiper>
  26. <!-- 公告 -->
  27. <view class = "swiper_ac_container">
  28. <uni-icons custom-prefix="iconfont" type="qungonggao"></uni-icons>
  29. <swiper class="swiper_ac" autoplay circular vertical='true'>
  30. <swiper-item v-for="(item, index) in announcements" :key="index">
  31. <view class="announcement-item">
  32. <text class="announcement-text" style="color: #397496;">{{ item.title }}</text>
  33. </view>
  34. </swiper-item>
  35. </swiper>
  36. </view>
  37. <view class="order_Entry_container" @click="orderEntry">
  38. <uni-icons ></uni-icons>
  39. <text style="color: #115881;font-weight: bold;margin-left: 20rpx;" >录入订单</text>
  40. <uni-icons class="order_Entry_end" type="right" :size="25" color="#306e91"></uni-icons>
  41. </view>
  42. <view v-if="isshow" class="show_container">
  43. <view class="isshow-header">
  44. <uni-icons class=" isshow-header-content-icon" type="search" :size="20"></uni-icons>
  45. <uni-easyinput class=" isshow-header-content-input" v-model="ServiceName" placeholder="请输入服务名称" focus="true" />
  46. <text class="isshow-header-content-text" @click="searchName">搜索</text>
  47. </view>
  48. <view class="isshow-content" >
  49. <text class="isshow-content-text" v-for="(item, index) in textcontent" :key="index" >{{item}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. ServiceName:'',
  59. title:"北京汽车有限公司",
  60. isshow:false,
  61. announcements: [
  62. '公告1:欢迎使用车辆合同生成系统!',
  63. '公告2:请及时查看最新用户协议。',
  64. '公告3:隐私政策已更新,请知悉。'
  65. ],
  66. textcontent: [
  67. '公告1:欢迎使用车辆合同生成系统!',
  68. '公告2:请及时查看最新用户协议。',
  69. '公告3:隐私政策已更新,请知悉。',
  70. '公告1:欢迎使用车辆合同生成系统!',
  71. '公告2:请及时查看最新用户协议。',
  72. '公告3:隐私政策已更新,请知悉。'
  73. ],
  74. };
  75. },
  76. onLoad() {
  77. uni.request({
  78. url: 'https://gpt.aiym.run/contract/miniapp/notice/list', //仅为示例,并非真实接口地址。
  79. method:'GET',
  80. data: {
  81. },
  82. header: {
  83. 'X-Access-Token': 'hello' //自定义请求头信息
  84. },
  85. success: (res) => {
  86. console.log(res.data.result);
  87. this.announcements = res.data.result;
  88. }
  89. });
  90. },
  91. methods: {
  92. change_text(){
  93. if(this.isshow){
  94. this.isshow=false;
  95. }else{
  96. this.isshow=true;
  97. console.log('111')
  98. }
  99. },
  100. orderEntry(){
  101. console.log('111')
  102. },
  103. // 搜索城市名字
  104. searchName(){
  105. }
  106. }
  107. };
  108. </script>
  109. <style>
  110. .container {
  111. display: flex;
  112. flex-direction: column;
  113. height: 100vh;
  114. background-color: #f5f5f5;
  115. }
  116. /* 头部 */
  117. .header {
  118. padding: 20px;
  119. width: 100%;
  120. height: 15%;
  121. background-color: #044f7a;
  122. color: #fff;
  123. display: flex;
  124. flex-direction: row;
  125. align-items: center;
  126. }
  127. .header_info{
  128. width: 100%;
  129. display: flex;
  130. flex-direction: row;
  131. align-items: center;
  132. color: #e0e9ef;
  133. }
  134. .header_text{
  135. width: 45%;
  136. white-space: nowrap;/*设置不换行*/
  137. overflow: hidden; /*设置隐藏*/
  138. text-overflow: ellipsis; /*设置隐藏部分为省略号*/
  139. }
  140. .header_change{
  141. width: 100%;
  142. display: flex;
  143. flex-direction: row;
  144. align-items: center;
  145. }
  146. /* 订单录入 */
  147. .order_Entry_container{
  148. width: 90%;
  149. height: 8%;
  150. background-color: #d9e5eb;
  151. border-radius: 10rpx;
  152. left:5%;
  153. display: flex;
  154. flex-direction: row;
  155. align-items: center;
  156. margin-top: 10%;
  157. }
  158. .order_Entry_end{
  159. margin-left: auto;
  160. margin-right: 7%;
  161. }
  162. /* 轮播图 */
  163. .swiper {
  164. height: 30%;
  165. width: 100%;
  166. display: flex;
  167. flex-direction: row;
  168. align-items: center;
  169. }
  170. .swiper-image {
  171. width: 100%;
  172. height: 100%;
  173. margin: 0 auto;
  174. }
  175. .form {
  176. flex: 1;
  177. padding: 20px;
  178. }
  179. .submit-button {
  180. width: 100%;
  181. height: 40px;
  182. background-color: #007aff;
  183. color: #fff;
  184. border: none;
  185. border-radius: 4px;
  186. font-size: 16px;
  187. }
  188. .footer {
  189. display: flex;
  190. justify-content: space-around;
  191. padding: 10px;
  192. background-color: #fff;
  193. border-top: 1px solid #ccc;
  194. }
  195. .nav-item {
  196. text-align: center;
  197. }
  198. .nav-item text {
  199. font-size: 14px;
  200. }
  201. .icon-image{
  202. width: 30%;
  203. height: 140px;
  204. margin: 0 auto;
  205. margin-top: 20px;
  206. }
  207. /* 轮播公告 */
  208. .swiper_ac_container{
  209. width: 100%;
  210. height: 6%;
  211. background-color: #e7eef2;
  212. display: flex;
  213. flex-direction: row;
  214. }
  215. .swiper_ac {
  216. width: 70%;
  217. height: 100%;
  218. }
  219. /* 轮播项 */
  220. .announcement-item {
  221. display: flex;
  222. justify-content: center;
  223. align-items: center;
  224. height: 100%;
  225. }
  226. /* 公告文字 */
  227. .announcement-text {
  228. font-size: 15px;
  229. color: #6996af;
  230. }
  231. /* 遮罩层 */
  232. .show_container{
  233. width: 60%;
  234. height: 36%;
  235. background-color: #ffffff;
  236. position: absolute;
  237. border-radius: 20rpx;
  238. /* border: 1px solid; */
  239. box-shadow: 0px 3rpx 0px #e4e4e4;
  240. left:5%;
  241. top: 13%;
  242. z-index:999;
  243. display: flex;
  244. flex-direction: column;
  245. align-items: center;
  246. }
  247. .isshow-header{
  248. width: 90%;
  249. height: 30%;
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. flex-direction: row;
  254. color: #3c7697;
  255. }
  256. .isshow-header-content-icon{
  257. width: 10%;
  258. height: 30%;
  259. }
  260. .isshow-header-content-input{
  261. width: 80%;
  262. height: 40%;
  263. margin: 0 20rpx 0 20rpx;
  264. border:none;
  265. outline:none;
  266. }
  267. .isshow-content{
  268. height: 70%;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. overflow-y:scroll;
  273. }
  274. .isshow-content-text{
  275. color: #414141;
  276. height: 30rpx;
  277. width: 100%;
  278. line-height: 30rpx;
  279. margin: 20rpx 0 20rpx 0;
  280. font-size: 30rpx;
  281. }
  282. .isshow-content::-webkit-scrollbar {
  283. display: none;
  284. }
  285. </style>